Versions in this module Expand all Collapse all v0 v0.1.0 Apr 15, 2026 Changes in this version + const ExtDeprecatedReason + const ExtEnumVarNames + const ExtJSONIgnore + const ExtNameOverride + const ExtOmitEmpty + const ExtOmitZero + const ExtOrder + const ExtSkipOptionalPointer + const ExtTypeNameOverride + const ExtTypeOverride + const ServerTypeChi + const ServerTypeEcho + const ServerTypeEchoV4 + const ServerTypeFiber + const ServerTypeGin + const ServerTypeGorilla + const ServerTypeIris + const ServerTypeStdHTTP + var DefaultTypeMapping = TypeMapping + func ComputeBodyNameTag(contentType string) string + func ComputeSchemaNames(schemas []*SchemaDescriptor, converter *NameConverter, ...) + func DefaultContentTypeShortNames() map[string][]string + func DefaultContentTypes() []string + func DefaultParamExplode(location string) bool + func DefaultParamStyle(location string) string + func FormatTagsMap(tags map[string]string) string + func Generate(doc libopenapi.Document, specData []byte, cfg Configuration) (string, error) + func GenerateAdditionalPropertiesCode(typeName string, fields []StructField, addPropsType string) (string, error) + func GenerateApplyDefaultsCode(typeName string, fields []StructField) (string, bool, error) + func GenerateEnumFromInfo(info *EnumInfo) string + func GenerateStruct(name string, fields []StructField, doc string, tagGen *StructTagGenerator) string + func GenerateStructWithAdditionalProps(name string, fields []StructField, addPropsType string, doc string, ...) string + func GenerateTypeAlias(name, targetType, doc string) string + func GenerateUnionCode(cfg UnionTypeConfig) (string, error) + func IsGoKeyword(s string) bool + func IsMediaTypeJSON(contentType string) bool + func LowercaseFirstCharacter(s string) string + func MediaTypeToCamelCase(mediaType string) string + func ToCamelCase(s string) string + func ToGoIdentifier(s string) string + func UppercaseFirstCharacter(s string) string + func ValidateParamStyle(style, location string) error + type AllOfMergeError struct + PropertyName string + SchemaName string + Type1 string + Type2 string + func (e AllOfMergeError) Error() string + type ClientGenerator struct + func NewClientGenerator(schemaIndex map[string]*SchemaDescriptor, generateSimple bool, ...) (*ClientGenerator, error) + func (g *ClientGenerator) GenerateBase() (string, error) + func (g *ClientGenerator) GenerateClient(ops []*OperationDescriptor) (string, error) + func (g *ClientGenerator) GenerateInterface(data SenderTemplateData) (string, error) + func (g *ClientGenerator) GenerateMethods(data SenderTemplateData) (string, error) + func (g *ClientGenerator) GenerateParamTypes(ops []*OperationDescriptor) (string, error) + func (g *ClientGenerator) GenerateRequestBodyTypes(ops []*OperationDescriptor) string + func (g *ClientGenerator) GenerateRequestBuilders(data SenderTemplateData) (string, error) + func (g *ClientGenerator) GenerateSimple(data SenderTemplateData) (string, error) + type CodeBuilder struct + func NewCodeBuilder() *CodeBuilder + func (b *CodeBuilder) BlankLine() + func (b *CodeBuilder) Dedent() + func (b *CodeBuilder) Indent() + func (b *CodeBuilder) Line(format string, args ...any) + func (b *CodeBuilder) Raw(s string) + func (b *CodeBuilder) String() string + type CodegenContext struct + func NewCodegenContext() *CodegenContext + func (c *CodegenContext) AddImport(path string) + func (c *CodegenContext) AddImportAlias(path, alias string) + func (c *CodegenContext) AddImports(imports map[string]string) + func (c *CodegenContext) AddJSONImport() + func (c *CodegenContext) AddJSONImports() + func (c *CodegenContext) AddTemplateImports(imports []templates.Import) + func (c *CodegenContext) HasRuntimePackage() bool + func (c *CodegenContext) Imports() map[string]string + func (c *CodegenContext) RuntimeHelpersPrefix() string + func (c *CodegenContext) RuntimeParamsPrefix() string + func (c *CodegenContext) RuntimeTypesPrefix() string + func (c *CodegenContext) SetRuntimePrefixes(params, types, helpers string) + type Configuration struct + ContentTypeShortNames map[string][]string + ContentTypes []string + Generation GenerationOptions + ImportMapping map[string]string + NameMangling NameMangling + NameSubstitutions NameSubstitutions + Output string + OutputOptions OutputOptions + PackageName string + StructTags StructTagsConfig + TypeMapping TypeMapping + func (c *Configuration) ApplyDefaults() + type ContentTypeMatcher struct + func NewContentTypeMatcher(patterns []string) *ContentTypeMatcher + func (m *ContentTypeMatcher) Matches(contentType string) bool + type ContentTypeShortNamer struct + func NewContentTypeShortNamer(mappings map[string][]string) *ContentTypeShortNamer + func (n *ContentTypeShortNamer) ShortName(contentType string) string + type DiscriminatorInfo struct + IsExplicit bool + Mapping map[string]string + PropertyName string + type EnumInfo struct + BaseType string + CustomNames []string + Doc string + PrefixTypeName bool + SanitizedNames []string + SchemaPath string + TypeName string + Values []string + type Extensions struct + DeprecatedReason string + EnumVarNames []string + JSONIgnore *bool + NameOverride string + OmitEmpty *bool + OmitZero *bool + Order *int + SkipOptionalPointer *bool + TypeNameOverride string + TypeOverride *TypeOverride + func ParseExtensions(extensions *orderedmap.Map[string, *yaml.Node], path string) (*Extensions, error) + type ExternalImport struct + Alias string + Path string + type FormatMapping struct + Default SimpleTypeSpec + Formats map[string]SimpleTypeSpec + type GenerationOptions struct + CallbackInitiator bool + CallbackReceiver bool + Client bool + ModelsPackage *ModelsPackage + RuntimePackage *RuntimePackageConfig + Server string + SimpleClient bool + WebhookInitiator bool + WebhookReceiver bool + type ImportResolver struct + func NewImportResolver(importMapping map[string]string) (*ImportResolver, error) + func (r *ImportResolver) AllImports() []ExternalImport + func (r *ImportResolver) Resolve(specPath string) *ExternalImport + type InitiatorGenerator struct + func NewInitiatorGenerator(prefix string, schemaIndex map[string]*SchemaDescriptor, generateSimple bool, ...) (*InitiatorGenerator, error) + func (g *InitiatorGenerator) GenerateBase(ops []*OperationDescriptor) (string, error) + func (g *InitiatorGenerator) GenerateInitiator(ops []*OperationDescriptor) (string, error) + func (g *InitiatorGenerator) GenerateInterface(data SenderTemplateData) (string, error) + func (g *InitiatorGenerator) GenerateMethods(data SenderTemplateData) (string, error) + func (g *InitiatorGenerator) GenerateParamTypes(ops []*OperationDescriptor) (string, error) + func (g *InitiatorGenerator) GenerateRequestBodyTypes(ops []*OperationDescriptor) string + func (g *InitiatorGenerator) GenerateRequestBuilders(data SenderTemplateData) (string, error) + func (g *InitiatorGenerator) GenerateSimple(data SenderTemplateData) (string, error) + type ModelsPackage struct + Alias string + Path string + func (m *ModelsPackage) Name() string + func (m *ModelsPackage) Prefix() string + type NameConverter struct + func NewNameConverter(mangling NameMangling, substitutions NameSubstitutions) *NameConverter + func (c *NameConverter) ToEnumValueName(value string, baseType string) string + func (c *NameConverter) ToPropertyName(name string) string + func (c *NameConverter) ToTypeName(name string) string + func (c *NameConverter) ToTypeNamePart(name string) string + func (c *NameConverter) ToVariableName(name string) string + type NameMangling struct + CharacterSubstitutions map[string]string + Initialisms []string + KeywordPrefix string + NumericPrefix string + WordSeparators string + func DefaultNameMangling() NameMangling + func (n NameMangling) Merge(user NameMangling) NameMangling + type NameSubstitutions struct + PropertyNames map[string]string + TypeNames map[string]string + type OperationDescriptor struct + Bodies []*RequestBodyDescriptor + CallbackName string + CookieParams []*ParameterDescriptor + Description string + GoOperationID string + HasBody bool + HasParams bool + HeaderParams []*ParameterDescriptor + Method string + OperationID string + ParamsTypeName string + ParentOpID string + Path string + PathParams []*ParameterDescriptor + QueryParams []*ParameterDescriptor + Responses []*ResponseDescriptor + Security []SecurityRequirement + Source OperationSource + Spec *v3.Operation + Summary string + WebhookName string + func FilterOperations(ops []*OperationDescriptor, opts OutputOptions) []*OperationDescriptor + func FilterOperationsByOperationID(ops []*OperationDescriptor, opts OutputOptions) []*OperationDescriptor + func FilterOperationsByTag(ops []*OperationDescriptor, opts OutputOptions) []*OperationDescriptor + func GatherCallbackOperations(doc *v3.Document, ctx *CodegenContext, contentTypeMatcher *ContentTypeMatcher, ...) ([]*OperationDescriptor, error) + func GatherOperations(doc *v3.Document, ctx *CodegenContext, contentTypeMatcher *ContentTypeMatcher, ...) ([]*OperationDescriptor, error) + func GatherWebhookOperations(doc *v3.Document, ctx *CodegenContext, contentTypeMatcher *ContentTypeMatcher, ...) ([]*OperationDescriptor, error) + func (o *OperationDescriptor) AllParams() []*ParameterDescriptor + func (o *OperationDescriptor) DefaultBody() *RequestBodyDescriptor + func (o *OperationDescriptor) DefaultTypedBody() *RequestBodyDescriptor + func (o *OperationDescriptor) HasTypedBody() bool + func (o *OperationDescriptor) Params() []*ParameterDescriptor + func (o *OperationDescriptor) SummaryAsComment() string + type OperationSource string + const OperationSourceCallback + const OperationSourcePath + const OperationSourceWebhook + type Output struct + func NewOutput(packageName string) *Output + func (o *Output) AddImport(path, alias string) + func (o *Output) AddImports(imports map[string]string) + func (o *Output) AddType(code string) + func (o *Output) Format() (string, error) + func (o *Output) String() string + type OutputOptions struct + AlwaysPrefixEnumValues bool + ExcludeOperationIDs []string + ExcludeSchemas []string + ExcludeTags []string + IncludeOperationIDs []string + IncludeTags []string + PruneUnreferencedSchemas bool + type ParameterDescriptor struct + Explode bool + GoName string + IsJSON bool + IsPassThrough bool + IsStyled bool + Location string + Name string + Required bool + Schema *SchemaDescriptor + Spec *v3.Parameter + Style string + TypeDecl string + func (p *ParameterDescriptor) AllowReserved() bool + func (p *ParameterDescriptor) GoVariableName() string + func (p *ParameterDescriptor) HasOptionalPointer() bool + func (p *ParameterDescriptor) SchemaFormat() string + func (p *ParameterDescriptor) SchemaType() string + type ReceiverGenerator struct + func NewReceiverGenerator(prefix string, serverType string, rp RuntimePrefixes) (*ReceiverGenerator, error) + func (g *ReceiverGenerator) GenerateErrors() (string, error) + func (g *ReceiverGenerator) GenerateParamTypes(ops []*OperationDescriptor) (string, error) + func (g *ReceiverGenerator) GenerateReceiver(ops []*OperationDescriptor) (string, error) + type ReceiverTemplateData struct + Operations []*OperationDescriptor + Prefix string + PrefixLower string + type RequestBodyDescriptor struct + ContentType string + Encoding map[string]RequestBodyEncoding + FuncSuffix string + GenerateTyped bool + GoTypeName string + IsDefault bool + IsFormEncoded bool + NameTag string + Required bool + Schema *SchemaDescriptor + type RequestBodyEncoding struct + ContentType string + Explode *bool + Style string + type ResponseContentDescriptor struct + ContentType string + IsJSON bool + NameTag string + Schema *SchemaDescriptor + type ResponseDescriptor struct + Contents []*ResponseContentDescriptor + Description string + Headers []*ResponseHeaderDescriptor + Ref string + StatusCode string + func (r *ResponseDescriptor) GoName() string + func (r *ResponseDescriptor) HasFixedStatusCode() bool + type ResponseHeaderDescriptor struct + GoName string + Name string + Required bool + Schema *SchemaDescriptor + type RuntimeOutput struct + Helpers string + Params string + Types string + func GenerateRuntime(baseImportPath string) (*RuntimeOutput, error) + type RuntimePackageConfig struct + Path string + func (r *RuntimePackageConfig) HelpersImport() string + func (r *RuntimePackageConfig) ParamsImport() string + func (r *RuntimePackageConfig) TypesImport() string + type RuntimePrefixes struct + Helpers string + Params string + Types string + func (rp RuntimePrefixes) FuncMap() template.FuncMap + type SchemaContext int + const ContextAdditionalProperties + const ContextAllOf + const ContextAnyOf + const ContextCallback + const ContextComponentSchema + const ContextHeader + const ContextItems + const ContextOneOf + const ContextParameter + const ContextProperty + const ContextRequestBody + const ContextResponse + const ContextUnknown + const ContextWebhook + type SchemaDescriptor struct + AdditionalProps *SchemaDescriptor + AllOf []*SchemaDescriptor + AnyOf []*SchemaDescriptor + ContentType string + Discriminator *DiscriminatorInfo + Extensions *Extensions + Items *SchemaDescriptor + OneOf []*SchemaDescriptor + OperationID string + Parent *SchemaDescriptor + Path SchemaPath + Properties map[string]*SchemaDescriptor + Ref string + Schema *base.Schema + ShortName string + StableName string + func FilterSchemasByName(schemas []*SchemaDescriptor, excludeNames []string) []*SchemaDescriptor + func GatherSchemas(doc *v3.Document, contentTypeMatcher *ContentTypeMatcher, ...) ([]*SchemaDescriptor, error) + func PruneUnreferencedSchemas(schemas []*SchemaDescriptor) []*SchemaDescriptor + func (d *SchemaDescriptor) IsComponentSchema() bool + func (d *SchemaDescriptor) IsExternalReference() bool + func (d *SchemaDescriptor) IsReference() bool + func (d *SchemaDescriptor) IsTopLevelComponentSchema() bool + func (d *SchemaDescriptor) ParseExternalRef() (filePath, internalPath string) + type SchemaKind int + const KindAlias + const KindAllOf + const KindAnyOf + const KindEnum + const KindMap + const KindOneOf + const KindReference + const KindStruct + func GetSchemaKind(desc *SchemaDescriptor) SchemaKind + type SchemaPath []string + func (p SchemaPath) Append(elements ...string) SchemaPath + func (p SchemaPath) ContainsProperties() bool + func (p SchemaPath) String() string + type SecurityRequirement struct + Name string + Scopes []string + type SenderTemplateData struct + ErrorType string + IsClient bool + Operations []*OperationDescriptor + OptionType string + Prefix string + PrefixLower string + Receiver string + SimpleType string + TypeName string + type ServerGenerator struct + func NewServerGenerator(serverType string, rp RuntimePrefixes) (*ServerGenerator, error) + func (g *ServerGenerator) GenerateErrors() (string, error) + func (g *ServerGenerator) GenerateHandler(ops []*OperationDescriptor) (string, error) + func (g *ServerGenerator) GenerateInterface(ops []*OperationDescriptor) (string, error) + func (g *ServerGenerator) GenerateParamTypes(ops []*OperationDescriptor) (string, error) + func (g *ServerGenerator) GenerateServer(ops []*OperationDescriptor) (string, error) + func (g *ServerGenerator) GenerateWrapper(ops []*OperationDescriptor) (string, error) + type SimpleTypeSpec struct + Import string + Template string + Type string + type StructField struct + Default string + Doc string + IsExternal bool + IsNullableAlias bool + IsStruct bool + JSONIgnore bool + JSONName string + Name string + Nullable bool + OmitEmpty bool + OmitZero bool + Order *int + Pointer bool + Required bool + Type string + type StructTagGenerator struct + func NewStructTagGenerator(config StructTagsConfig) *StructTagGenerator + func (g *StructTagGenerator) GenerateTags(info StructTagInfo) string + func (g *StructTagGenerator) GenerateTagsMap(info StructTagInfo) map[string]string + type StructTagInfo struct + FieldName string + IsOptional bool + type StructTagTemplate struct + Name string + Template string + type StructTagsConfig struct + Tags []StructTagTemplate + func DefaultStructTagsConfig() StructTagsConfig + func (c StructTagsConfig) Merge(other StructTagsConfig) StructTagsConfig + type TypeGenerator struct + func NewTypeGenerator(typeMapping TypeMapping, converter *NameConverter, ...) *TypeGenerator + func (g *TypeGenerator) AddImport(path string) + func (g *TypeGenerator) AddImportAlias(path, alias string) + func (g *TypeGenerator) AddJSONImport() + func (g *TypeGenerator) AddJSONImports() + func (g *TypeGenerator) AdditionalPropertiesType(desc *SchemaDescriptor) string + func (g *TypeGenerator) GenerateStructFields(desc *SchemaDescriptor) []StructField + func (g *TypeGenerator) GoTypeExpr(desc *SchemaDescriptor) string + func (g *TypeGenerator) HasAdditionalProperties(desc *SchemaDescriptor) bool + func (g *TypeGenerator) Imports() map[string]string + func (g *TypeGenerator) IndexSchemas(schemas []*SchemaDescriptor) + func (g *TypeGenerator) TagGenerator() *StructTagGenerator + type TypeMapping struct + Boolean FormatMapping + Integer FormatMapping + Number FormatMapping + String FormatMapping + func (base TypeMapping) Merge(user TypeMapping) TypeMapping + type TypeOverride struct + ImportAlias string + ImportPath string + TypeName string + type UnionMember struct + DiscriminatorValues []string + HasApplyDefaults bool + Index int + MethodName string + TypeName string + type UnionTypeConfig struct + Converter *NameConverter + Discriminator *DiscriminatorInfo + Doc string + FixedFields []StructField + HelperPrefix string + IsOneOf bool + Members []UnionMember + TagGen *StructTagGenerator + TypeName string