code: func (v *Vendorer) addGeneratedOpenAPIRule(paths []string) error {
  	var openAPITargets []string
  	var vendorTargets []string
  	for _, p := range paths {
  		if !strings.HasPrefix(p, baseImport) {
  			return fmt.Errorf("openapi-gen path outside of kubernetes: %s", p)
  		}
  		np := p[len(baseImport):]
  		if strings.HasPrefix(np, staging) {
  			vendorTargets = append(vendorTargets, np[len(staging):])
  		} else {
  			openAPITargets = append(openAPITargets, np)
  		}
  	}
  	sort.Strings(openAPITargets)
  	sort.Strings(vendorTargets)
  
  	pkgPath := filepath.Join("pkg", "generated", "openapi")
  	for _, r := range v.newRules[pkgPath] {
  		if r.Name() == "go_default_library" {
  			r.SetAttr("openapi_targets", asExpr(openAPITargets))
  			r.SetAttr("vendor_targets", asExpr(vendorTargets))
  			break
  		}
  	}
  	return nil
  }
docs: // addGeneratedOpenAPIRule updates the pkg/generated/openapi go_default_library
  // rule with the automanaged openapi_targets and vendor_targets.