Skip to content

Commit

Permalink
feat: add useClassNamesForArrayFields config
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanSpeakEasy committed Dec 5, 2023
1 parent 8b786d0 commit 58d0480
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,18 @@ type UsageSnippets struct {
}

type Generation struct {
Comments *Comments `yaml:"comments,omitempty"`
DevContainers *DevContainers `yaml:"devContainers,omitempty"`
BaseServerURL string `yaml:"baseServerUrl,omitempty"`
SDKClassName string `yaml:"sdkClassName,omitempty"`
SingleTagPerOp bool `yaml:"singleTagPerOp,omitempty"`
TagNamespacingDisabled bool `yaml:"tagNamespacingDisabled,omitempty"`
RepoURL string `yaml:"repoURL,omitempty"`
MaintainOpenAPIOrder bool `yaml:"maintainOpenAPIOrder,omitempty"`
UsageSnippets *UsageSnippets `yaml:"usageSnippets,omitempty"`
AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility
Comments *Comments `yaml:"comments,omitempty"`
DevContainers *DevContainers `yaml:"devContainers,omitempty"`
BaseServerURL string `yaml:"baseServerUrl,omitempty"`
SDKClassName string `yaml:"sdkClassName,omitempty"`
SingleTagPerOp bool `yaml:"singleTagPerOp,omitempty"`
TagNamespacingDisabled bool `yaml:"tagNamespacingDisabled,omitempty"`
RepoURL string `yaml:"repoURL,omitempty"`
MaintainOpenAPIOrder bool `yaml:"maintainOpenAPIOrder,omitempty"`
UsageSnippets *UsageSnippets `yaml:"usageSnippets,omitempty"`
UseClassNamesForArrayFields bool `yaml:"useClassNamesForArrayFields,omitempty"`

AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility
}

type DevContainers struct {
Expand Down Expand Up @@ -287,6 +289,12 @@ func GetGenerationDefaults(newSDK bool) []SDKGenConfigField {
DefaultValue: ptr(OptionalPropertyRenderingOptionWithExample),
Description: pointer.To("Controls how optional properties are rendered in usage snippets, by default they will be rendered when an example is present in the OpenAPI spec"),
},
{
Name: "useClassNamesForArrayFields",
Required: false,
DefaultValue: ptr(newSDK),
Description: pointer.To("Use class names for array fields instead of the child's schema type"),
},
}
}

Expand Down

0 comments on commit 58d0480

Please sign in to comment.