Generate inside $package-path in the file $package-name.go the Golang structures according to the local JSON Schema $schema-path.
The generation must follow the coding structure provided below.
Code structure
// Code generated by AI ({ModelVersion}).
package $package-name
// ObjectName <object description>.
type ObjectName struct {
// PropertyName <the property description>.
PropertyName <the property type> `json:"propertyName,omitempty" yaml:"property_name,omitempty"`
// EnumName <the enum description>.
//
// Enums:
// - <value>
// - <value>
//
// Examples:
// - <value>
// - <value>
EnumName <the enum type> `json:"enumName,omitempty" yaml:"enum_name,omitempty"`
// ChildObject <object description>.
ChildObject *ChildObject `json:"childObject,omitempty" yaml:"child_object,omitempty"`
// ArrayName <array description>.
ArrayName []<the array type> `json:"arrayName,omitempty" yaml:"array_name,omitempty"`
}
// ChildObject <object description>.
type ChildObject struct {
...
}
- In case of
allOfwith$ref, merge both objects into the samestruct(fields must be sorted alphabetically). - Respect the GoDoc format: A GoDoc comment always start with the property name, field name, struct name and ends with a dot.
- Respect the GoDoc format: Adapt the first word(s) of descriptions to avoid repetitions or non-conjugated (third singular person) sentences.
- Struct fields must be sorted exactly as ordered in the schema.
- Add newlines between
structfields. - Add newlines when a description has newlines (same places).
- No need to create method for 'default' or 'enum' to verify the validity of fields.
- No need to parse conditions 'if', 'else'.
- Replace
{ModelVersion}by the current AI model and version used to generate the files (e.g. 'Claude Sonnet 4.6', etc.).
Constants
For all 'enums' values, the available values must be created as const inside constants.go with below code structure.
// Code generated by AI ({ModelVersion}).
package $package-name
const (
EnumName<Option Name> = <value>
)
const (
AnotherEnumName<Option Name> = <value>
)
- All constants must be sorted alphabetically within a
const (...)section. - Never add unnecessary prefixes (e.g. 'CI...').
- Replace
{ModelVersion}by the current AI model and version used to generate the files (e.g. 'GPT-5-Codex', 'Claude Sonnet 4.0', etc.).