codegen

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package codegen provides data structures for code generation from OpenAPI specs. These structures mirror the Java implementation in openapi-generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodegenCallback

type CodegenCallback struct {
	Name       string              `json:"name"`
	Operations []*CodegenOperation `json:"operations"`
}

CodegenCallback represents a callback

type CodegenComposedSchemas

type CodegenComposedSchemas struct {
	AllOf []*CodegenProperty `json:"allOf"`
	OneOf []*CodegenProperty `json:"oneOf"`
	AnyOf []*CodegenProperty `json:"anyOf"`
	Not   *CodegenProperty   `json:"not"`
}

CodegenComposedSchemas holds composed schema references

type CodegenDiscriminator

type CodegenDiscriminator struct {
	PropertyName     string `json:"propertyName"`
	PropertyBaseName string `json:"propertyBaseName"`
	PropertyGetter   string `json:"propertyGetter"`
	PropertyType     string `json:"propertyType"`
	IsEnum           bool   `json:"isEnum"`

	// Mapping: discriminator value -> schema name
	Mapping      map[string]string `json:"mapping"`
	MappedModels []*MappedModel    `json:"mappedModels"`

	VendorExtensions map[string]any `json:"vendorExtensions"`
}

CodegenDiscriminator represents a discriminator for polymorphic types. It is the Go equivalent of org.openapitools.codegen.CodegenDiscriminator.

type CodegenMediaType

type CodegenMediaType struct {
	Schema   *CodegenProperty `json:"schema"`
	Encoding map[string]any   `json:"encoding"`
}

CodegenMediaType represents media type content

type CodegenModel

type CodegenModel struct {
	// Identity
	Name          string `json:"name"`          // Name (escaped if reserved)
	SchemaName    string `json:"schemaName"`    // Original schema name from OAS
	Classname     string `json:"classname"`     // Language-specific class name
	ClassVarName  string `json:"classVarName"`  // Variable name for the class
	ClassFilename string `json:"classFilename"` // File name for the model

	// Documentation
	Title                string `json:"title"`
	Description          string `json:"description"`
	UnescapedDescription string `json:"unescapedDescription"`

	// Type info
	DataType       string `json:"dataType"` // Language-specific data type
	ArrayModelType string `json:"arrayModelType"`
	IsAlias        bool   `json:"isAlias"` // Is this an alias of a simple type?
	IsEnum         bool   `json:"isEnum"`
	IsArray        bool   `json:"isArray"`
	IsMap          bool   `json:"isMap"`
	IsNullable     bool   `json:"isNullable"`
	IsDeprecated   bool   `json:"isDeprecated"`

	// Primitive type flags
	IsString         bool `json:"isString"`
	IsInteger        bool `json:"isInteger"`
	IsLong           bool `json:"isLong"`
	IsNumber         bool `json:"isNumber"`
	IsNumeric        bool `json:"isNumeric"`
	IsFloat          bool `json:"isFloat"`
	IsDouble         bool `json:"isDouble"`
	IsDecimal        bool `json:"isDecimal"`
	IsDate           bool `json:"isDate"`
	IsDateTime       bool `json:"isDateTime"`
	IsBoolean        bool `json:"isBoolean"`
	IsFreeFormObject bool `json:"isFreeFormObject"`
	IsPrimitiveType  bool `json:"isPrimitiveType"`

	// Inheritance
	Parent       string          `json:"parent"` // Parent model name
	ParentSchema string          `json:"parentSchema"`
	Interfaces   []string        `json:"interfaces"` // Implemented interfaces
	AllParents   []string        `json:"allParents"` // All parent names
	ParentModel  *CodegenModel   `json:"-"`          // Reference to parent model
	Children     []*CodegenModel `json:"-"`          // Child models

	// Composition (oneOf/anyOf/allOf)
	OneOf           []string                `json:"oneOf"`       // Set of oneOf schema names
	OneOfModels     []string                `json:"oneOfModels"` // Non-primitive oneOf members for imports
	AnyOf           []string                `json:"anyOf"`       // Set of anyOf schema names
	AllOf           []string                `json:"allOf"`       // Set of allOf schema names
	ComposedSchemas *CodegenComposedSchemas `json:"composedSchemas"`

	// Properties
	Vars            []*CodegenProperty `json:"vars"`         // Properties (without parent's)
	AllVars         []*CodegenProperty `json:"allVars"`      // All properties (with parent's)
	RequiredVars    []*CodegenProperty `json:"requiredVars"` // Required properties
	OptionalVars    []*CodegenProperty `json:"optionalVars"`
	ReadOnlyVars    []*CodegenProperty `json:"readOnlyVars"`
	ReadWriteVars   []*CodegenProperty `json:"readWriteVars"`
	ParentVars      []*CodegenProperty `json:"parentVars"`
	NonNullableVars []*CodegenProperty `json:"nonNullableVars"`

	// Required tracking
	Mandatory       []string `json:"mandatory"`    // Required property names (without parent's)
	AllMandatory    []string `json:"allMandatory"` // All required (with parent's)
	HasRequired     bool     `json:"hasRequired"`
	HasOptional     bool     `json:"hasOptional"`
	HasVars         bool     `json:"hasVars"`
	HasReadOnly     bool     `json:"hasReadOnly"`
	EmptyVars       bool     `json:"emptyVars"`
	HasEnums        bool     `json:"hasEnums"`
	HasOnlyReadOnly bool     `json:"hasOnlyReadOnly"`
	HasChildren     bool     `json:"hasChildren"`
	HasMoreModels   bool     `json:"hasMoreModels"`
	HasOneOf        bool     `json:"hasOneOf"`

	// Enum support
	AllowableValues map[string]any `json:"allowableValues"` // {"values": [...]}

	// Discriminator
	Discriminator                       *CodegenDiscriminator `json:"discriminator"`
	HasDiscriminatorWithNonEmptyMapping bool                  `json:"hasDiscriminatorWithNonEmptyMapping"`

	// Additional properties
	AdditionalPropertiesType   string           `json:"additionalPropertiesType"`
	IsAdditionalPropertiesTrue bool             `json:"isAdditionalPropertiesTrue"`
	AdditionalProperties       *CodegenProperty `json:"additionalProperties"`

	// Imports
	Imports []string `json:"imports"`

	// Vendor extensions
	VendorExtensions map[string]any `json:"vendorExtensions"`

	// XML
	XmlPrefix    string `json:"xmlPrefix"`
	XmlNamespace string `json:"xmlNamespace"`
	XmlName      string `json:"xmlName"`

	// Validation (from IJsonSchemaValidationProperties)
	Pattern          string   `json:"pattern"`
	Minimum          string   `json:"minimum"`
	Maximum          string   `json:"maximum"`
	MinLength        *int     `json:"minLength"`
	MaxLength        *int     `json:"maxLength"`
	MinItems         *int     `json:"minItems"`
	MaxItems         *int     `json:"maxItems"`
	MinProperties    *int     `json:"minProperties"`
	MaxProperties    *int     `json:"maxProperties"`
	UniqueItems      bool     `json:"uniqueItems"`
	ExclusiveMinimum bool     `json:"exclusiveMinimum"`
	ExclusiveMaximum bool     `json:"exclusiveMaximum"`
	MultipleOf       *float64 `json:"multipleOf"`

	// External documentation
	ExternalDocumentation map[string]any `json:"externalDocumentation"`

	// Items for array models
	Items *CodegenProperty `json:"items"`

	// Default value
	DefaultValue string `json:"defaultValue"`

	// JSON representation
	ModelJson string `json:"modelJson"`
}

CodegenModel represents a schema/model in the OpenAPI document. It is the Go equivalent of org.openapitools.codegen.CodegenModel.

type CodegenOperation

type CodegenOperation struct {
	// Identity
	OperationId          string `json:"operationId"`
	OperationIdOriginal  string `json:"operationIdOriginal"`
	OperationIdLowerCase string `json:"operationIdLowerCase"`
	OperationIdCamelCase string `json:"operationIdCamelCase"`
	OperationIdSnakeCase string `json:"operationIdSnakeCase"`

	// HTTP
	Path       string `json:"path"`
	HttpMethod string `json:"httpMethod"`
	BaseName   string `json:"baseName"` // Tag name
	Nickname   string `json:"nickname"` // Method name

	// Documentation
	Summary        string `json:"summary"`
	Notes          string `json:"notes"`
	UnescapedNotes string `json:"unescapedNotes"`

	// Parameters (categorized)
	AllParams      []*CodegenParameter `json:"allParams"`
	BodyParams     []*CodegenParameter `json:"bodyParams"`
	PathParams     []*CodegenParameter `json:"pathParams"`
	QueryParams    []*CodegenParameter `json:"queryParams"`
	HeaderParams   []*CodegenParameter `json:"headerParams"`
	FormParams     []*CodegenParameter `json:"formParams"`
	CookieParams   []*CodegenParameter `json:"cookieParams"`
	RequiredParams []*CodegenParameter `json:"requiredParams"`
	OptionalParams []*CodegenParameter `json:"optionalParams"`
	BodyParam      *CodegenParameter   `json:"bodyParam"`

	// Response
	ReturnType      string             `json:"returnType"`
	ReturnBaseType  string             `json:"returnBaseType"`
	ReturnContainer string             `json:"returnContainer"`
	ReturnFormat    string             `json:"returnFormat"`
	ReturnProperty  *CodegenProperty   `json:"returnProperty"`
	Responses       []*CodegenResponse `json:"responses"`
	ResponseHeaders []*CodegenProperty `json:"responseHeaders"`
	DefaultResponse string             `json:"defaultResponse"`

	// Content types
	Consumes    []map[string]string `json:"consumes"` // [{"mediaType": "application/json"}]
	Produces    []map[string]string `json:"produces"`
	HasConsumes bool                `json:"hasConsumes"`
	HasProduces bool                `json:"hasProduces"`

	// Prioritized content types
	PrioritizedContentTypes []map[string]string `json:"prioritizedContentTypes"`

	// Flags
	IsDeprecated           bool `json:"isDeprecated"`
	IsCallbackRequest      bool `json:"isCallbackRequest"`
	HasAuthMethods         bool `json:"hasAuthMethods"`
	HasOptionalParams      bool `json:"hasOptionalParams"`
	ReturnTypeIsPrimitive  bool `json:"returnTypeIsPrimitive"`
	ReturnSimpleType       bool `json:"returnSimpleType"`
	IsMap                  bool `json:"isMap"`
	IsArray                bool `json:"isArray"`
	IsMultipart            bool `json:"isMultipart"`
	IsVoid                 bool `json:"isVoid"`
	IsResponseBinary       bool `json:"isResponseBinary"`
	IsResponseFile         bool `json:"isResponseFile"`
	IsResponseOptional     bool `json:"isResponseOptional"`
	HasReference           bool `json:"hasReference"`
	HasErrorResponseObject bool `json:"hasErrorResponseObject"`
	UniqueItems            bool `json:"uniqueItems"`
	SubresourceOperation   bool `json:"subresourceOperation"`

	// Security
	AuthMethods []*CodegenSecurity `json:"authMethods"`

	// Servers
	Servers []*CodegenServer `json:"servers"`

	// Callbacks
	Callbacks []*CodegenCallback `json:"callbacks"`

	// Examples
	Examples            []map[string]string `json:"examples"`
	RequestBodyExamples []map[string]string `json:"requestBodyExamples"`

	// Discriminator
	Discriminator *CodegenDiscriminator `json:"discriminator"`

	// Imports
	Imports []string `json:"imports"`

	// Tags
	Tags []map[string]string `json:"tags"`

	// Vendor extensions
	VendorExtensions map[string]any `json:"vendorExtensions"`

	// External docs
	ExternalDocs map[string]any `json:"externalDocs"`
}

CodegenOperation represents an API operation. It is the Go equivalent of org.openapitools.codegen.CodegenOperation.

type CodegenParameter

type CodegenParameter struct {
	// Names
	BaseName  string `json:"baseName"`  // Original name
	ParamName string `json:"paramName"` // Language-specific name

	// Case variants
	NameInLowerCase  string `json:"nameInLowerCase"`
	NameInCamelCase  string `json:"nameInCamelCase"`
	NameInPascalCase string `json:"nameInPascalCase"`
	NameInSnakeCase  string `json:"nameInSnakeCase"`

	// Type
	DataType         string `json:"dataType"`
	DatatypeWithEnum string `json:"datatypeWithEnum"`
	DataFormat       string `json:"dataFormat"`
	BaseType         string `json:"baseType"`
	ContentType      string `json:"contentType"`

	// Location flags
	IsFormParam   bool `json:"isFormParam"`
	IsQueryParam  bool `json:"isQueryParam"`
	IsPathParam   bool `json:"isPathParam"`
	IsHeaderParam bool `json:"isHeaderParam"`
	IsCookieParam bool `json:"isCookieParam"`
	IsBodyParam   bool `json:"isBodyParam"`

	// Type flags
	IsContainer      bool `json:"isContainer"`
	IsArray          bool `json:"isArray"`
	IsMap            bool `json:"isMap"`
	IsPrimitiveType  bool `json:"isPrimitiveType"`
	IsModel          bool `json:"isModel"`
	IsString         bool `json:"isString"`
	IsInteger        bool `json:"isInteger"`
	IsLong           bool `json:"isLong"`
	IsNumber         bool `json:"isNumber"`
	IsFloat          bool `json:"isFloat"`
	IsDouble         bool `json:"isDouble"`
	IsDecimal        bool `json:"isDecimal"`
	IsBoolean        bool `json:"isBoolean"`
	IsNumeric        bool `json:"isNumeric"`
	IsByteArray      bool `json:"isByteArray"`
	IsBinary         bool `json:"isBinary"`
	IsFile           bool `json:"isFile"`
	IsDate           bool `json:"isDate"`
	IsDateType       bool `json:"isDateType"` // Computed: same as IsDate (for template compatibility)
	IsDateTime       bool `json:"isDateTime"`
	IsDateTimeType   bool `json:"isDateTimeType"` // Computed: same as IsDateTime (for template compatibility)
	IsUuid           bool `json:"isUuid"`
	IsUri            bool `json:"isUri"`
	IsEmail          bool `json:"isEmail"`
	IsFreeFormObject bool `json:"isFreeFormObject"`
	IsAnyType        bool `json:"isAnyType"`

	// Enum
	IsEnum          bool           `json:"isEnum"`
	IsEnumRef       bool           `json:"isEnumRef"`
	Enum            []string       `json:"enum"`
	EnumName        string         `json:"enumName"`
	AllowableValues map[string]any `json:"allowableValues"`

	// Validation
	Required         bool     `json:"required"`
	IsNullable       bool     `json:"isNullable"`
	IsDeprecated     bool     `json:"isDeprecated"`
	HasValidation    bool     `json:"hasValidation"`
	Pattern          string   `json:"pattern"`
	Minimum          string   `json:"minimum"`
	Maximum          string   `json:"maximum"`
	MinLength        *int     `json:"minLength"`
	MaxLength        *int     `json:"maxLength"`
	MinItems         *int     `json:"minItems"`
	MaxItems         *int     `json:"maxItems"`
	UniqueItems      bool     `json:"uniqueItems"`
	ExclusiveMinimum bool     `json:"exclusiveMinimum"`
	ExclusiveMaximum bool     `json:"exclusiveMaximum"`
	MultipleOf       *float64 `json:"multipleOf"`

	// Style
	Style                   string `json:"style"`
	IsExplode               bool   `json:"isExplode"`
	IsDeepObject            bool   `json:"isDeepObject"`
	IsMatrix                bool   `json:"isMatrix"`
	IsFormStyle             bool   `json:"isFormStyle"`
	IsSpaceDelimited        bool   `json:"isSpaceDelimited"`
	IsPipeDelimited         bool   `json:"isPipeDelimited"`
	IsAllowEmptyValue       bool   `json:"isAllowEmptyValue"`
	CollectionFormat        string `json:"collectionFormat"`
	IsCollectionFormatMulti bool   `json:"isCollectionFormatMulti"`

	// Nested
	Items                *CodegenProperty   `json:"items"`
	AdditionalProperties *CodegenProperty   `json:"additionalProperties"`
	Vars                 []*CodegenProperty `json:"vars"`
	RequiredVars         []*CodegenProperty `json:"requiredVars"`
	MostInnerItems       *CodegenProperty   `json:"mostInnerItems"`

	// Documentation
	Description          string         `json:"description"`
	UnescapedDescription string         `json:"unescapedDescription"`
	Example              string         `json:"example"`
	Examples             map[string]any `json:"examples"`
	JsonSchema           string         `json:"jsonSchema"`
	DefaultValue         string         `json:"defaultValue"`
	EnumDefaultValue     string         `json:"enumDefaultValue"`

	// Content (for complex parameters)
	Content map[string]*CodegenMediaType `json:"content"`

	// Vendor extensions
	VendorExtensions map[string]any `json:"vendorExtensions"`

	// HasVars and HasRequired
	HasVars     bool `json:"hasVars"`
	HasRequired bool `json:"hasRequired"`

	// MinProperties and MaxProperties
	MinProperties *int `json:"minProperties"`
	MaxProperties *int `json:"maxProperties"`
}

CodegenParameter represents an operation parameter. It is the Go equivalent of org.openapitools.codegen.CodegenParameter.

type CodegenProperty

type CodegenProperty struct {
	// Names
	Name     string `json:"name"`     // Language-specific variable name
	BaseName string `json:"baseName"` // Original property name from OAS
	Getter   string `json:"getter"`
	Setter   string `json:"setter"`

	// Case variants
	NameInLowerCase  string `json:"nameInLowerCase"`
	NameInCamelCase  string `json:"nameInCamelCase"`
	NameInPascalCase string `json:"nameInPascalCase"`
	NameInSnakeCase  string `json:"nameInSnakeCase"`

	// Type info - note: templates use lowercase "datatype" so we provide both
	OpenApiType         string `json:"openApiType"` // Type from OAS (string, integer, etc.)
	DataType            string `json:"dataType"`    // Language-specific type
	Datatype            string `json:"datatype"`    // Alias for templates using lowercase
	BaseType            string `json:"baseType"`    // Base type (for containers)
	ComplexType         string `json:"complexType"` // Complex/model type name
	DataFormat          string `json:"dataFormat"`  // Format (date-time, uuid, etc.)
	DatatypeWithEnum    string `json:"datatypeWithEnum"`
	ContainerType       string `json:"containerType"`       // "array", "map", "set"
	ContainerTypeMapped string `json:"containerTypeMapped"` // Language-specific container

	// Documentation
	Title                string `json:"title"`
	Description          string `json:"description"`
	UnescapedDescription string `json:"unescapedDescription"`
	Example              string `json:"example"`
	JsonSchema           string `json:"jsonSchema"`

	// Flags
	Required    bool `json:"required"`
	Deprecated  bool `json:"deprecated"`
	IsReadOnly  bool `json:"isReadOnly"`
	IsWriteOnly bool `json:"isWriteOnly"`
	IsNullable  bool `json:"isNullable"`

	// Type flags
	IsPrimitiveType  bool `json:"isPrimitiveType"`
	IsModel          bool `json:"isModel"`
	IsContainer      bool `json:"isContainer"`
	IsArray          bool `json:"isArray"`
	IsMap            bool `json:"isMap"`
	IsOptional       bool `json:"isOptional"`
	IsString         bool `json:"isString"`
	IsNumeric        bool `json:"isNumeric"`
	IsInteger        bool `json:"isInteger"`
	IsLong           bool `json:"isLong"`
	IsShort          bool `json:"isShort"`
	IsNumber         bool `json:"isNumber"`
	IsFloat          bool `json:"isFloat"`
	IsDouble         bool `json:"isDouble"`
	IsDecimal        bool `json:"isDecimal"`
	IsByteArray      bool `json:"isByteArray"`
	IsBinary         bool `json:"isBinary"`
	IsFile           bool `json:"isFile"`
	IsBoolean        bool `json:"isBoolean"`
	IsDate           bool `json:"isDate"`
	IsDateType       bool `json:"isDateType"` // Computed: same as IsDate (for template compatibility)
	IsDateTime       bool `json:"isDateTime"`
	IsDateTimeType   bool `json:"isDateTimeType"` // Computed: same as IsDateTime (for template compatibility)
	IsUuid           bool `json:"isUuid"`
	IsUri            bool `json:"isUri"`
	IsEmail          bool `json:"isEmail"`
	IsPassword       bool `json:"isPassword"`
	IsNull           bool `json:"isNull"`
	IsFreeFormObject bool `json:"isFreeFormObject"`
	IsAnyType        bool `json:"isAnyType"`
	IsEnum           bool `json:"isEnum"`
	IsInnerEnum      bool `json:"isInnerEnum"` // Inline enum
	IsEnumRef        bool `json:"isEnumRef"`   // Reference to enum model

	// Enum
	Enum            []string       `json:"enum"`
	EnumName        string         `json:"enumName"`
	AllowableValues map[string]any `json:"allowableValues"`

	// Nested types
	Items                *CodegenProperty   `json:"items"` // For arrays/maps
	AdditionalProperties *CodegenProperty   `json:"additionalProperties"`
	MostInnerItems       *CodegenProperty   `json:"mostInnerItems"`
	Vars                 []*CodegenProperty `json:"vars"` // For object types
	RequiredVars         []*CodegenProperty `json:"requiredVars"`

	// Default value
	DefaultValue          string `json:"defaultValue"`
	DefaultValueWithParam string `json:"defaultValueWithParam"`

	// Validation
	Pattern          string   `json:"pattern"`
	Minimum          string   `json:"minimum"`
	Maximum          string   `json:"maximum"`
	MinLength        *int     `json:"minLength"`
	MaxLength        *int     `json:"maxLength"`
	MinItems         *int     `json:"minItems"`
	MaxItems         *int     `json:"maxItems"`
	UniqueItems      bool     `json:"uniqueItems"`
	ExclusiveMinimum bool     `json:"exclusiveMinimum"`
	ExclusiveMaximum bool     `json:"exclusiveMaximum"`
	MultipleOf       *float64 `json:"multipleOf"`
	HasValidation    bool     `json:"hasValidation"`
	Min              string   `json:"min"`
	Max              string   `json:"max"`

	// Inheritance
	IsInherited         bool   `json:"isInherited"`
	IsNew               bool   `json:"isNew"` // Property overrides parent
	IsOverridden        *bool  `json:"isOverridden"`
	IsSelfReference     bool   `json:"isSelfReference"`
	IsCircularReference bool   `json:"isCircularReference"`
	IsDiscriminator     bool   `json:"isDiscriminator"`
	DiscriminatorValue  string `json:"discriminatorValue"`

	// Vendor extensions
	VendorExtensions map[string]any `json:"vendorExtensions"`

	// XML
	IsXmlAttribute bool   `json:"isXmlAttribute"`
	IsXmlWrapped   bool   `json:"isXmlWrapped"`
	XmlPrefix      string `json:"xmlPrefix"`
	XmlName        string `json:"xmlName"`
	XmlNamespace   string `json:"xmlNamespace"`

	// Composition
	ComposedSchemas *CodegenComposedSchemas `json:"composedSchemas"`
}

CodegenProperty represents a property within a model. It is the Go equivalent of org.openapitools.codegen.CodegenProperty.

type CodegenResponse

type CodegenResponse struct {
	Code    string `json:"code"` // "200", "404", "default", etc.
	Message string `json:"message"`

	// Status code categories
	Is1xx     bool `json:"is1xx"`
	Is2xx     bool `json:"is2xx"`
	Is3xx     bool `json:"is3xx"`
	Is4xx     bool `json:"is4xx"`
	Is5xx     bool `json:"is5xx"`
	IsDefault bool `json:"isDefault"`

	// Type info
	DataType      string `json:"dataType"`
	BaseType      string `json:"baseType"`
	ContainerType string `json:"containerType"`

	// Type flags
	IsString         bool `json:"isString"`
	IsInteger        bool `json:"isInteger"`
	IsLong           bool `json:"isLong"`
	IsNumber         bool `json:"isNumber"`
	IsFloat          bool `json:"isFloat"`
	IsDouble         bool `json:"isDouble"`
	IsDecimal        bool `json:"isDecimal"`
	IsBoolean        bool `json:"isBoolean"`
	IsNumeric        bool `json:"isNumeric"`
	IsModel          bool `json:"isModel"`
	IsArray          bool `json:"isArray"`
	IsMap            bool `json:"isMap"`
	IsBinary         bool `json:"isBinary"`
	IsFile           bool `json:"isFile"`
	IsPrimitiveType  bool `json:"isPrimitiveType"`
	IsFreeFormObject bool `json:"isFreeFormObject"`
	IsAnyType        bool `json:"isAnyType"`
	IsUuid           bool `json:"isUuid"`
	IsEmail          bool `json:"isEmail"`
	IsNull           bool `json:"isNull"`
	IsVoid           bool `json:"isVoid"`

	// Headers
	Headers         []*CodegenProperty  `json:"headers"`
	ResponseHeaders []*CodegenParameter `json:"responseHeaders"`
	HasHeaders      bool                `json:"hasHeaders"`

	// Content
	Content map[string]*CodegenMediaType `json:"content"`

	// Nested
	Items                *CodegenProperty   `json:"items"`
	AdditionalProperties *CodegenProperty   `json:"additionalProperties"`
	Vars                 []*CodegenProperty `json:"vars"`
	ReturnProperty       *CodegenProperty   `json:"returnProperty"`

	// Examples
	Examples []map[string]any `json:"examples"`

	// Validation flags
	SimpleType    bool `json:"simpleType"`
	PrimitiveType bool `json:"primitiveType"`
	HasValidation bool `json:"hasValidation"`

	// Required vars
	RequiredVars []*CodegenProperty `json:"requiredVars"`

	// Vendor extensions
	VendorExtensions map[string]any `json:"vendorExtensions"`

	// Schema
	Schema     *CodegenProperty `json:"schema"`
	JsonSchema string           `json:"jsonSchema"`

	// Wildcard flag
	IsWildcard        bool   `json:"isWildcard"`
	WildcardCodeGroup string `json:"wildcardCodeGroup"`

	// Description
	Description          string `json:"description"`
	UnescapedDescription string `json:"unescapedDescription"`

	// Min/Max items
	MinItems    *int `json:"minItems"`
	MaxItems    *int `json:"maxItems"`
	UniqueItems bool `json:"uniqueItems"`
}

CodegenResponse represents an API response. It is the Go equivalent of org.openapitools.codegen.CodegenResponse.

type CodegenSecurity

type CodegenSecurity struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`   // "apiKey", "http", "oauth2", "openIdConnect"
	Scheme      string `json:"scheme"` // "basic", "bearer", etc.

	// Type flags
	IsBasic         bool `json:"isBasic"`
	IsBasicBasic    bool `json:"isBasicBasic"`  // Basic auth
	IsBasicBearer   bool `json:"isBasicBearer"` // Bearer token
	IsApiKey        bool `json:"isApiKey"`
	IsOAuth         bool `json:"isOAuth"`
	IsOpenId        bool `json:"isOpenId"`
	IsHttpSignature bool `json:"isHttpSignature"`

	// Bearer
	BearerFormat string `json:"bearerFormat"`

	// API Key
	KeyParamName  string `json:"keyParamName"`
	IsKeyInQuery  bool   `json:"isKeyInQuery"`
	IsKeyInHeader bool   `json:"isKeyInHeader"`
	IsKeyInCookie bool   `json:"isKeyInCookie"`

	// OAuth
	Flow             string           `json:"flow"`
	AuthorizationUrl string           `json:"authorizationUrl"`
	TokenUrl         string           `json:"tokenUrl"`
	RefreshUrl       string           `json:"refreshUrl"`
	Scopes           []map[string]any `json:"scopes"`
	HasScopes        bool             `json:"hasScopes"`
	IsCode           bool             `json:"isCode"`
	IsPassword       bool             `json:"isPassword"`
	IsApplication    bool             `json:"isApplication"`
	IsImplicit       bool             `json:"isImplicit"`

	// OpenID
	OpenIdConnectUrl string `json:"openIdConnectUrl"`

	// Vendor extensions
	VendorExtensions map[string]any `json:"vendorExtensions"`
}

CodegenSecurity represents authentication/authorization configuration. It is the Go equivalent of org.openapitools.codegen.CodegenSecurity.

type CodegenServer

type CodegenServer struct {
	URL         string         `json:"url"`
	Description string         `json:"description"`
	Variables   map[string]any `json:"variables"`
}

CodegenServer represents server configuration

type MappedModel

type MappedModel struct {
	MappingName     string        `json:"mappingName"`     // Value in payload
	ModelName       string        `json:"modelName"`       // Schema/model name
	Model           *CodegenModel `json:"-"`               // Reference to model
	ExplicitMapping bool          `json:"explicitMapping"` // From spec vs inferred
}

MappedModel represents a discriminator mapping entry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL