code: func GenerateDefinition(modelNames []string, opts *GenOpts) error {
  	if opts == nil {
  		return errors.New("gen opts are required")
  	}
  
  	if opts.TemplateDir != "" {
  		if err := templates.LoadDir(opts.TemplateDir); err != nil {
  			return err
  		}
  	}
  
  	if err := opts.CheckOpts(); err != nil {
  		return err
  	}
  
  	// Load the spec
  	specPath, specDoc, err := loadSpec(opts.Spec)
  	if err != nil {
  		return err
  	}
  
  	if len(modelNames) == 0 {
  		for k := range specDoc.Spec().Definitions {
  			modelNames = append(modelNames, k)
  		}
  	}
  
  	for _, modelName := range modelNames {
  		// lookup schema
  		model, ok := specDoc.Spec().Definitions[modelName]
  		if !ok {
  			return fmt.Errorf("model %q not found in definitions given by %q", modelName, specPath)
  		}
  
  		// generate files
  		generator := definitionGenerator{
  			Name:    modelName,
  			Model:   model,
  			SpecDoc: specDoc,
  			Target: filepath.Join(
  				opts.Target,
  				filepath.FromSlash(opts.LanguageOpts.ManglePackagePath(opts.ModelPackage, ""))),
  			opts: opts,
  		}
  
  		if err := generator.Generate(); err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: /*
  Rewrite specification document first:
  
  * anonymous objects
  * tuples
  * extensible objects (properties + additionalProperties)
  * AllOfs when they match the rewrite criteria (not a nullable allOf)
  
  Find string enums and generate specialized idiomatic enum with them
  
  Every action that happens tracks the path which is a linked list of refs
  
  
  */
  // GenerateDefinition generates a model file for a schema definition.