generators/generate.go
func Generate(packagename string, fileBytes []byte, outputDir string) {
	b := preprocessJobManifest(fileBytes)
	objects := make(map[string]map[string]ObjectField)
	var properties []string
	for _, v := range b.recs {
		properties = append(properties, v.Orig)
	}
	for i := 0; i < b.max; i++ {

		for _, v := range b.recs {
			if v.Length-1 >= i {

				var structname = v.StructName(i, packagename, properties)
				var typeName = v.TypeName(i, properties)
				elementName := v.Slice[i]
				attributeName := FormatName(elementName)

				if _, ok := objects[structname]; !ok {
					objects[structname] = make(map[string]ObjectField)
				}

				if previousElement, ok := objects[structname][attributeName]; !ok {
					lo.G.Debug("Adding", attributeName, "to", structname, "with type", typeName)
					objects[structname][attributeName] = ObjectField{
						ElementName:       attributeName,
						ElementType:       typeName,
						ElementAnnotation: createElementAnnotation(elementName),
						Meta:              v.Yaml,
					}
				} else {
					if previousElement.ElementAnnotation != createElementAnnotation(elementName) {
						lo.G.Warning("******** Recommended creating custom yaml marshaller on", structname, "for", attributeName, " ********")
						previousElement.ElementAnnotation = "`yaml:\"-\"`"
						objects[structname][attributeName] = previousElement
					}
				}
			}
		}
	}
	structs := generateStructs(objects, packagename)
	writeStructsToDisk(structs, outputDir)
}
func Generate(packagename string, fileBytes []byte, outputDir string) {
	b := preprocessJobManifest(fileBytes)
	objects := make(map[string]map[string]ObjectField)
	var properties []string
	for _, v := range b.recs {
		properties = append(properties, v.Orig)
	}
	for i := 0; i < b.max; i++ {

		for _, v := range b.recs {
			if v.Length-1 >= i {

				var structname = v.StructName(i, packagename, properties)
				var typeName = v.TypeName(i, properties)
				elementName := v.Slice[i]
				attributeName := FormatName(elementName)

				if _, ok := objects[structname]; !ok {
					objects[structname] = make(map[string]ObjectField)
				}

				if previousElement, ok := objects[structname][attributeName]; !ok {
					lo.G.Debug("Adding", attributeName, "to", structname, "with type", typeName)
					objects[structname][attributeName] = ObjectField{
						ElementName:       attributeName,
						ElementType:       typeName,
						ElementAnnotation: createElementAnnotation(elementName),
						Meta:              v.Yaml,
					}
				} else {
					if previousElement.ElementAnnotation != createElementAnnotation(elementName) {
						lo.G.Warning("******** Recommended creating custom yaml marshaller on", structname, "for", attributeName, " ********")
						previousElement.ElementAnnotation = "`yaml:\"-\"`"
						objects[structname][attributeName] = previousElement
					}
				}
			}
		}
	}
	structs := generateStructs(objects, packagename)
	writeStructsToDisk(structs, outputDir)
}
//Generate - used to generate a struct for a given job