I want to generate a struct with attributes ordered as defined in the OpenAPI specification doc.
Api specification:
Settings:
type: object
required:
- name
- enabled
properties:
name:
type: string
enum: [ setting-a, setting-b, setting-c, setting-d ]
enabled:
type: boolean
The generated struct attributes are sorted alphabetically:
type Setting struct {
Enabled bool `json:"enabled"`
Name SettingName `json:"name"`
}
but I would like the struct to be defined as
type Setting struct {
Name SettingName `json:"name"`
Enabled bool `json:"enabled"`
}