{"modulePath":"github.com/dewrich/oapi-codegen/v2","version":"v2.0.0-20260520214014-86e9840a67d7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package codegen\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\n## Variables\n\n```go\nvar DefaultTypeMapping = TypeMapping{\n\tInteger: FormatMapping{\n\t\tDefault: SimpleTypeSpec{Type: \"int\"},\n\t\tFormats: map[string]SimpleTypeSpec{\n\t\t\t\"int\":    {Type: \"int\"},\n\t\t\t\"int8\":   {Type: \"int8\"},\n\t\t\t\"int16\":  {Type: \"int16\"},\n\t\t\t\"int32\":  {Type: \"int32\"},\n\t\t\t\"int64\":  {Type: \"int64\"},\n\t\t\t\"uint\":   {Type: \"uint\"},\n\t\t\t\"uint8\":  {Type: \"uint8\"},\n\t\t\t\"uint16\": {Type: \"uint16\"},\n\t\t\t\"uint32\": {Type: \"uint32\"},\n\t\t\t\"uint64\": {Type: \"uint64\"},\n\t\t},\n\t},\n\tNumber: FormatMapping{\n\t\tDefault: SimpleTypeSpec{Type: \"float32\"},\n\t\tFormats: map[string]SimpleTypeSpec{\n\t\t\t\"float\":  {Type: \"float32\"},\n\t\t\t\"double\": {Type: \"float64\"},\n\t\t},\n\t},\n\tBoolean: FormatMapping{\n\t\tDefault: SimpleTypeSpec{Type: \"bool\"},\n\t},\n\tString: FormatMapping{\n\t\tDefault: SimpleTypeSpec{Type: \"string\"},\n\t\tFormats: map[string]SimpleTypeSpec{\n\t\t\t\"byte\":      {Type: \"[]byte\"},\n\t\t\t\"email\":     {Type: \"openapi_types.Email\"},\n\t\t\t\"date\":      {Type: \"openapi_types.Date\"},\n\t\t\t\"date-time\": {Type: \"time.Time\", Import: \"time\"},\n\t\t\t\"json\":      {Type: \"json.RawMessage\", Import: \"encoding/json\"},\n\t\t\t\"uuid\":      {Type: \"openapi_types.UUID\"},\n\t\t\t\"binary\":    {Type: \"openapi_types.File\"},\n\t\t},\n\t},\n}\n```\nDefaultTypeMapping provides the default OpenAPI type/format to Go type mappings.\n\n```go\nvar NameNormalizers = NameNormalizerMap{\n\tNameNormalizerFunctionUnset:                      ToCamelCase,\n\tNameNormalizerFunctionToCamelCase:                ToCamelCase,\n\tNameNormalizerFunctionToCamelCaseWithDigits:      ToCamelCaseWithDigits,\n\tNameNormalizerFunctionToCamelCaseWithInitialisms: ToCamelCaseWithInitialisms,\n}\n```\nNameNormalizers contains the valid options for \\`NameNormalizerFunction\\`s that \\`oapi-codegen\\` supports.\n\nIf you are calling \\`oapi-codegen\\` as a library, this allows you to specify your own normalisation types before generating code.\n\n```go\nvar TemplateFunctions = template.FuncMap{\n\t\"genParamArgs\":               genParamArgs,\n\t\"genParamTypes\":              genParamTypes,\n\t\"genParamNames\":              genParamNames,\n\t\"genParamFmtString\":          ReplacePathParamsWithStr,\n\t\"swaggerUriToIrisUri\":        SwaggerUriToIrisUri,\n\t\"swaggerUriToEchoUri\":        SwaggerUriToEchoUri,\n\t\"swaggerUriToFiberUri\":       SwaggerUriToFiberUri,\n\t\"swaggerUriToChiUri\":         SwaggerUriToChiUri,\n\t\"swaggerUriToGinUri\":         SwaggerUriToGinUri,\n\t\"swaggerUriToGorillaUri\":     SwaggerUriToGorillaUri,\n\t\"swaggerUriToStdHttpUri\":     SwaggerUriToStdHttpUri,\n\t\"lcFirst\":                    LowercaseFirstCharacter,\n\t\"ucFirst\":                    UppercaseFirstCharacter,\n\t\"ucFirstWithPkgName\":         UppercaseFirstCharacterWithPkgName,\n\t\"camelCase\":                  ToCamelCase,\n\t\"genResponsePayload\":         genResponsePayload,\n\t\"genResponseTypeName\":        genResponseTypeName,\n\t\"genResponseUnmarshal\":       genResponseUnmarshal,\n\t\"getResponseTypeDefinitions\": getResponseTypeDefinitions,\n\t\"toStringArray\":              toStringArray,\n\t\"lower\":                      strings.ToLower,\n\t\"title\":                      titleCaser.String,\n\t\"stripNewLines\":              stripNewLines,\n\t\"sanitizeGoIdentity\":         SanitizeGoIdentity,\n\t\"schemaNameToTypeName\":       SchemaNameToTypeName,\n\t\"toGoString\":                 StringToGoString,\n\t\"toGoComment\":                StringWithTypeNameToGoComment,\n\n\t\"genServerURLWithVariablesFunctionParams\": genServerURLWithVariablesFunctionParams,\n\t\"httpMethodConstant\":                      httpMethodConstant,\n}\n```\nTemplateFunctions is passed to the template engine, and we can call each function here by keyName from the template code.\n\n## Functions\n\n```go\nfunc DeprecationComment(reason string) string\n```\n\n```go\nfunc EscapePathElements(path string) string\n```\nEscapePathElements breaks apart a path, and looks at each element. If it's not a path parameter, eg, {param}, it will URL-escape the element.\n\n```go\nfunc GenFieldsFromProperties(props []Property) []string\n```\nGenFieldsFromProperties produce corresponding field names with JSON annotations, given a list of schema descriptors\n\n```go\nfunc GenStructFromAllOf(allOf []*openapi3.SchemaRef, path []string) (string, error)\n```\nGenStructFromAllOf generates an object that is the union of the objects in the input array. In the case of Ref objects, we use an embedded struct, otherwise, we inline the fields.\n\n```go\nfunc GenStructFromSchema(schema Schema) string\n```\n\n```go\nfunc Generate(spec *openapi3.T, opts Configuration) (string, error)\n```\nGenerate uses the Go templating engine to generate all of our server wrappers from the descriptions we've built up above from the schema objects. opts defines\n\n```go\nfunc GenerateAdditionalPropertyBoilerplate(t *template.Template, typeDefs []TypeDefinition) (string, error)\n```\nGenerateAdditionalPropertyBoilerplate generates all the glue code which provides the API for interacting with additional properties and JSON-ification\n\n```go\nfunc GenerateBodyDefinitions(operationID string, bodyOrRef *openapi3.RequestBodyRef, pathItemRef string) ([]RequestBodyDefinition, []TypeDefinition, error)\n```\nGenerateBodyDefinitions turns the Swagger body definitions into a list of our body definitions which will be used for code generation.\n\npathItemRef is the path item's $ref (if any). When non-empty and pointing at an external file, the body type that would otherwise be hoisted locally is replaced by a reference to the imported package's same-named type — the imported package already declares it (with any As/From/Merge methods), so redeclaring locally would just produce an awkward duplicate with package-qualified union elements.\n\n```go\nfunc GenerateChiServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateChiServer generates all the go code for the ServerInterface as well as all the wrapper functions around our handlers.\n\n```go\nfunc GenerateClient(t *template.Template, ops []OperationDefinition) (string, error)\n```\nGenerateClient uses the template engine to generate the function which registers our wrappers as Echo path handlers.\n\n```go\nfunc GenerateClientWithResponses(t *template.Template, ops []OperationDefinition) (string, error)\n```\nGenerateClientWithResponses generates a client which extends the basic client which does response unmarshaling.\n\n```go\nfunc GenerateConstants(t *template.Template, ops []OperationDefinition) (string, error)\n```\nGenerateConstants generates operation ids, context keys, paths, etc. to be exported as constants\n\n```go\nfunc GenerateEcho5Server(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateEcho5Server generates all the go code for the ServerInterface as well as all the wrapper functions around our handlers.\n\n```go\nfunc GenerateEchoServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateEchoServer generates all the go code for the ServerInterface as well as all the wrapper functions around our handlers.\n\n```go\nfunc GenerateEnums(t *template.Template, types []TypeDefinition) (string, error)\n```\n\n```go\nfunc GenerateFiberServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateFiberServer generates all the go code for the ServerInterface as well as all the wrapper functions around our handlers.\n\n```go\nfunc GenerateGinServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateGinServer generates all the go code for the ServerInterface as well as all the wrapper functions around our handlers.\n\n```go\nfunc GenerateGorillaServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateGorillaServer generates all the go code for the ServerInterface as well as all the wrapper functions around our handlers.\n\n```go\nfunc GenerateImports(t *template.Template, externalImports []string, packageName string, versionOverride *string) (string, error)\n```\nGenerateImports generates our import statements and package definition.\n\n```go\nfunc GenerateInlinedSpec(t *template.Template, importMapping importMap, swagger *openapi3.T) (string, error)\n```\nGenerateInlinedSpec generates a gzipped, base64 encoded JSON representation of the swagger definition, which we embed inside the generated code.\n\n```go\nfunc GenerateIrisServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateIrisServer generates all the go code for the ServerInterface as well as all the wrapper functions around our handlers.\n\n```go\nfunc GenerateServerURLs(t *template.Template, spec *openapi3.T) (string, error)\n```\n\n```go\nfunc GenerateStdHTTPServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateStdHTTPServer generates all the go code for the ServerInterface as well as all the wrapper functions around our handlers.\n\n```go\nfunc GenerateStrictResponses(t *template.Template, responses []ResponseDefinition) (string, error)\n```\n\n```go\nfunc GenerateStrictServer(t *template.Template, operations []OperationDefinition, opts Configuration) (string, error)\n```\n\n```go\nfunc GenerateTemplates(templates []string, t *template.Template, ops any) (string, error)\n```\nGenerateTemplates used to generate templates\n\n```go\nfunc GenerateTypeDefinitions(t *template.Template, swagger *openapi3.T, ops []OperationDefinition, excludeSchemas []string) (string, error)\n```\n\n```go\nfunc GenerateTypes(t *template.Template, types []TypeDefinition) (string, error)\n```\nGenerateTypes passes a bunch of types to the template engine, and buffers its output into a string.\n\n```go\nfunc GenerateTypesForOperations(t *template.Template, ops []OperationDefinition) (string, error)\n```\nGenerateTypesForOperations generates code for all types produced within operations\n\n```go\nfunc GenerateUnionAndAdditionalProopertiesBoilerplate(t *template.Template, typeDefs []TypeDefinition) (string, error)\n```\n\n```go\nfunc GenerateUnionBoilerplate(t *template.Template, typeDefs []TypeDefinition) (string, error)\n```\n\n```go\nfunc GetParametersImports(params map[string]*openapi3.ParameterRef) (map[string]goImport, error)\n```\n\n```go\nfunc GetRequestBodiesImports(bodies map[string]*openapi3.RequestBodyRef) (map[string]goImport, error)\n```\n\n```go\nfunc GetResponsesImports(responses map[string]*openapi3.ResponseRef) (map[string]goImport, error)\n```\n\n```go\nfunc GetSchemaImports(schemas map[string]*openapi3.SchemaRef, excludeSchemas []string) (map[string]goImport, error)\n```\n\n```go\nfunc GetTypeDefinitionsImports(swagger *openapi3.T, excludeSchemas []string) (map[string]goImport, error)\n```\n\n```go\nfunc GetUserTemplateText(inputData string) (template string, err error)\n```\nGetUserTemplateText attempts to retrieve the template text from a passed in URL or file path when inputData is more than one line. This function will attempt to load a file first, and if it fails, will try to get the data from the remote endpoint. The timeout for remote download file is 30 seconds.\n\n```go\nfunc GoSchemaImports(schemas ...*openapi3.SchemaRef) (map[string]goImport, error)\n```\n\n```go\nfunc IsGoIdentity(str string) bool\n```\nIsGoIdentity checks if the given string can be used as an identity in the generated code like a type name or constant name.\n\nSee [https://golang.org/ref/spec#Identifiers](https://golang.org/ref/spec#Identifiers)\n\n```go\nfunc IsGoKeyword(str string) bool\n```\nIsGoKeyword returns whether the given string is a go keyword\n\n```go\nfunc IsGoTypeReference(ref string) bool\n```\nIsGoTypeReference takes a $ref value and checks if it has link to go type. #/components/schemas/Foo                     -\u003e true ./local/file.yml#/components/parameters/Bar  -\u003e true ./local/file.yml                             -\u003e false IsGoTypeReference can be used to check whether RefPathToGoType($ref) is possible.\n\n```go\nfunc IsPredeclaredGoIdentifier(str string) bool\n```\nIsPredeclaredGoIdentifier returns whether the given string is a predefined go identifier.\n\nSee [https://golang.org/ref/spec#Predeclared\\_identifiers](https://golang.org/ref/spec#Predeclared_identifiers)\n\n```go\nfunc IsValidGoIdentity(str string) bool\n```\nIsValidGoIdentity checks if the given string can be used as a name of variable, constant, or type.\n\n```go\nfunc IsWholeDocumentReference(ref string) bool\n```\nIsWholeDocumentReference takes a $ref value and checks if it is whole document reference. #/components/schemas/Foo                             -\u003e false ./local/file.yml#/components/parameters/Bar          -\u003e false ./local/file.yml                                     -\u003e true [http://deepmap.com/schemas/document.json](http://deepmap.com/schemas/document.json)             -\u003e true [http://deepmap.com/schemas/document.json#/Foo](http://deepmap.com/schemas/document.json#/Foo)        -\u003e false\n\n```go\nfunc LoadTemplates(src embed.FS, t *template.Template) error\n```\nLoadTemplates loads all of our template files into a text/template. The path of template is relative to the templates directory.\n\n```go\nfunc LowercaseFirstCharacter(str string) string\n```\nLowercaseFirstCharacter Lowercases the first character in a string. This assumes UTF-8, so we have to be careful with unicode, don't treat it as a byte array.\n\n```go\nfunc LowercaseFirstCharacters(str string) string\n```\nLowercase the first upper characters in a string for case of abbreviation. This assumes UTF-8, so we have to be careful with unicode, don't treat it as a byte array.\n\n```go\nfunc OperationImports(ops []OperationDefinition) (map[string]goImport, error)\n```\n\n```go\nfunc OperationSchemaImports(s *Schema) (map[string]goImport, error)\n```\n\n```go\nfunc OrderedParamsFromUri(uri string) []string\n```\nOrderedParamsFromUri returns the argument names, in order, in a given URI string, so for /path/{param1}/{.param2\\*}/{?param3}, it would return param1, param2, param3\n\n```go\nfunc ParseGoImportExtension(v *openapi3.SchemaRef) (*goImport, error)\n```\n\n```go\nfunc PathToTypeName(path []string) string\n```\nPathToTypeName converts a path, like Object/field1/nestedField into a go type name.\n\n```go\nfunc PropertiesEqual(a, b Property) bool\n```\n\n```go\nfunc RefPathToGoType(refPath string) (string, error)\n```\nRefPathToGoType takes a $ref value and converts it to a Go typename. #/components/schemas/Foo -\u003e Foo #/components/parameters/Bar -\u003e Bar #/components/responses/Baz -\u003e Baz Remote components (document.json#/Foo) are supported if they present in --import-mapping URL components ([http://deepmap.com/schemas/document.json#/Foo](http://deepmap.com/schemas/document.json#/Foo)) are supported if they present in --import-mapping Remote and URL also support standard local paths even though the spec doesn't mention them.\n\n```go\nfunc RefPathToObjName(refPath string) string\n```\nRefPathToObjName returns the name of referenced object without changes.\n\n\t#/components/schemas/Foo -\u003e Foo\n\t#/components/parameters/Bar -\u003e Bar\n\t#/components/responses/baz_baz -\u003e baz_baz\n\tdocument.json#/Foo -\u003e Foo\n\thttp://deepmap.com/schemas/document.json#/objObj -\u003e objObj\n\nDoes not check refPath correctness.\n\n```go\nfunc ReplacePathParamsWithStr(uri string) string\n```\nReplacePathParamsWithStr replaces path parameters of the form {param} with %s\n\n```go\nfunc ResolveNames(schemas []*GatheredSchema) map[string]string\n```\nResolveNames takes the gathered schemas and assigns unique Go type names to each. It returns a map from the schema's path string to the resolved Go type name.\n\n```go\nfunc SanitizeCode(goCode string) string\n```\nSanitizeCode runs sanitizers across the generated Go code to ensure the generated code will be able to compile.\n\n```go\nfunc SanitizeEnumNames(enumNames, enumValues []string) map[string]string\n```\nSanitizeEnumNames fixes illegal chars in the enum names and removes duplicates\n\n```go\nfunc SanitizeGoIdentifier(str string) string\n```\nSanitizeGoIdentifier replaces illegal runes in the given string so that it is a valid Go identifier. Unlike SanitizeGoIdentity, it does not prefix reserved keywords or predeclared identifiers. This is useful for contexts where the name must be a valid identifier but is not used as a Go symbol (e.g. net/http ServeMux wildcard names).\n\n```go\nfunc SanitizeGoIdentity(str string) string\n```\nSanitizeGoIdentity deletes and replaces the illegal runes in the given string to use the string as a valid identity. It also prefixes reserved keywords and predeclared identifiers with an underscore.\n\n```go\nfunc SchemaHasAdditionalProperties(schema *openapi3.Schema) bool\n```\nAccording to the spec, additionalProperties may be true, false, or a schema. If not present, true is implied. If it's a schema, true is implied. If it's false, no additional properties are allowed. We're going to act a little differently, in that if you want additionalProperties code to be generated, you must specify an additionalProperties type If additionalProperties it true/false, this field will be non-nil.\n\n```go\nfunc SchemaNameToTypeName(name string) string\n```\nSchemaNameToTypeName converts a Schema name to a valid Go type name. It converts to camel case, and makes sure the name is valid in Go\n\n```go\nfunc SetGlobalStateSpec(spec *openapi3.T)\n```\n\n```go\nfunc SortedMapKeys[T any](m map[string]T) []string\n```\nSortedMapKeys takes a map with keys of type string and returns a slice of those keys sorted lexicographically.\n\n```go\nfunc SortedSchemaKeys(dict map[string]*openapi3.SchemaRef) []string\n```\nSortedSchemaKeys returns the keys of the given SchemaRef dictionary in sorted order, since Golang scrambles dictionary keys. This isn't a generic key sort, because we support an extension to grant specific orders to schemas to help control output ordering.\n\n```go\nfunc SortedSecuritySchemeKeys(dict map[string]*openapi3.SecuritySchemeRef) []string\n```\nSortedSecuritySchemeKeys returns sorted keys for a SecuritySchemeRef dict\n\n```go\nfunc StringToGoComment(in string) string\n```\nStringToGoComment renders a possible multi-line string as a valid Go-Comment. Each line is prefixed as a comment.\n\n```go\nfunc StringToGoString(in string) string\n```\nStringToGoString takes an arbitrary string and converts it to a valid Go string literal, including the quotes. For instance, \\`foo \"bar\"\\` would be converted to \\`\"foo \\\\\"bar\\\\\"\"\\`\n\n```go\nfunc StringWithTypeNameToGoComment(in, typeName string) string\n```\nStringWithTypeNameToGoComment renders a possible multi-line string as a valid Go-Comment, including the name of the type being referenced. Each line is prefixed as a comment.\n\n```go\nfunc SwaggerUriToChiUri(uri string) string\n```\nSwaggerUriToChiUri converts a swagger style path URI with parameters to a Chi compatible path URI. We need to replace all Swagger parameters with \"{param}\". Valid input parameters are:\n\n\t{param}\n\t{param*}\n\t{.param}\n\t{.param*}\n\t{;param}\n\t{;param*}\n\t{?param}\n\t{?param*}\n\n```go\nfunc SwaggerUriToEchoUri(uri string) string\n```\nSwaggerUriToEchoUri converts a OpenAPI style path URI with parameters to an Echo compatible path URI. We need to replace all of OpenAPI parameters with \":param\". Valid input parameters are:\n\n\t{param}\n\t{param*}\n\t{.param}\n\t{.param*}\n\t{;param}\n\t{;param*}\n\t{?param}\n\t{?param*}\n\n```go\nfunc SwaggerUriToFiberUri(uri string) string\n```\nSwaggerUriToFiberUri converts a OpenAPI style path URI with parameters to a Fiber compatible path URI. We need to replace all of OpenAPI parameters with \":param\". Valid input parameters are:\n\n\t{param}\n\t{param*}\n\t{.param}\n\t{.param*}\n\t{;param}\n\t{;param*}\n\t{?param}\n\t{?param*}\n\n```go\nfunc SwaggerUriToGinUri(uri string) string\n```\nSwaggerUriToGinUri converts a swagger style path URI with parameters to a Gin compatible path URI. We need to replace all Swagger parameters with \":param\". Valid input parameters are:\n\n\t{param}\n\t{param*}\n\t{.param}\n\t{.param*}\n\t{;param}\n\t{;param*}\n\t{?param}\n\t{?param*}\n\n```go\nfunc SwaggerUriToGorillaUri(uri string) string\n```\nSwaggerUriToGorillaUri converts a swagger style path URI with parameters to a Gorilla compatible path URI. We need to replace all Swagger parameters with \":param\". Valid input parameters are:\n\n\t{param}\n\t{param*}\n\t{.param}\n\t{.param*}\n\t{;param}\n\t{;param*}\n\t{?param}\n\t{?param*}\n\n```go\nfunc SwaggerUriToIrisUri(uri string) string\n```\nSwaggerUriToIrisUri converts a OpenAPI style path URI with parameters to an Iris compatible path URI. We need to replace all of OpenAPI parameters with\n\n\t{param}\n\t{param*}\n\t{.param}\n\t{.param*}\n\t{;param}\n\t{;param*}\n\t{?param}\n\t{?param*}\n\n```go\nfunc SwaggerUriToStdHttpUri(uri string) string\n```\nSwaggerUriToStdHttpUri converts a swagger style path URI with parameters to a net/http ServeMux compatible path URI. Parameter names are sanitized to be valid Go identifiers, as required by ServeMux wildcard segments. Valid input parameters are:\n\n\t{param}\n\t{param*}\n\t{.param}\n\t{.param*}\n\t{;param}\n\t{;param*}\n\t{?param}\n\t{?param*}\n\n```go\nfunc ToCamelCase(str string) string\n```\nToCamelCase will convert query-arg style strings to CamelCase. We will use \\`., -, +, :, ;, \\_, ~, ' ', (, ), {, }, \\[, ]\\` as valid delimiters for words. So, \"word.word-word+word:word;word\\_word~word word(word)word{word}\\[word]\" would be converted to WordWordWordWordWordWordWordWordWordWordWordWordWord\n\n```go\nfunc ToCamelCaseWithDigits(s string) string\n```\nToCamelCaseWithDigits function will convert query-arg style strings to CamelCase. We will use \\`., -, +, :, ;, \\_, ~, ' ', (, ), {, }, \\[, ]\\` as valid delimiters for words. The difference of ToCamelCase that letter after a number becomes capitalized. So, \"word.word-word+word:word;word\\_word~word word(word)word{word}\\[word]3word\" would be converted to WordWordWordWordWordWordWordWordWordWordWordWordWord3Word\n\n```go\nfunc ToCamelCaseWithInitialism(str string) string\n```\n\n```go\nfunc ToCamelCaseWithInitialisms(s string) string\n```\nToCamelCaseWithInitialisms function will convert query-arg style strings to CamelCase with initialisms in uppercase. So, httpOperationId would be converted to HTTPOperationID\n\n```go\nfunc TypeDefinitionsEquivalent(t1, t2 TypeDefinition) bool\n```\nTypeDefinitionsEquivalent checks for equality between two type definitions, but not every field is considered. We only want to know if they are fundamentally the same type.\n\n```go\nfunc UppercaseFirstCharacter(str string) string\n```\nUppercaseFirstCharacter Uppercases the first character in a string. This assumes UTF-8, so we have to be careful with unicode, don't treat it as a byte array.\n\n```go\nfunc UppercaseFirstCharacterWithPkgName(str string) string\n```\nUppercase the first character in a identifier with pkg name. This assumes UTF-8, so we have to be careful with unicode, don't treat it as a byte array.\n\n## Types\n\n```go\ntype AdditionalImport struct {\n\tAlias   string `yaml:\"alias,omitempty\"`\n\tPackage string `yaml:\"package\"`\n}\n```\n\n```go\ntype CompatibilityOptions struct {\n\t// In the past, we merged schemas for `allOf` by inlining each schema\n\t// within the schema list. This approach, though, is incorrect because\n\t// `allOf` merges at the schema definition level, not at the resulting model\n\t// level. So, new behavior merges OpenAPI specs but generates different code\n\t// than we have in the past. Set OldMergeSchemas to true for the old behavior.\n\t// Please see https://github.com/dewrich/oapi-codegen/issues/531\n\tOldMergeSchemas bool `yaml:\"old-merge-schemas,omitempty\"`\n\t// In the past, when a schema combined `allOf` with sibling fields at the\n\t// same level (`properties`, `required`, `additionalProperties`,\n\t// `description`), those siblings were silently discarded and the schema\n\t// was emitted as a Go type alias to its sole `allOf` target. New behavior\n\t// merges the parent's siblings with the `allOf` members so the generated\n\t// type carries every field declared in the spec. This is a more accurate\n\t// translation of OpenAPI semantics, but it changes the shape of generated\n\t// types: a schema that previously produced `type X = Y` may now produce\n\t// a distinct struct embedding Y with extra fields, which is not\n\t// interchangeable with Y in downstream Go code. Set OldAllOfSiblingMerging\n\t// to true to restore the prior behavior.\n\t// Please see https://github.com/dewrich/oapi-codegen/issues/697\n\tOldAllOfSiblingMerging bool `yaml:\"old-allof-sibling-merging,omitempty\"`\n\t// Enum values can generate conflicting typenames, so we've updated the\n\t// code for enum generation to avoid these conflicts, but it will result\n\t// in some enum types being renamed in existing code. Set OldEnumConflicts to true\n\t// to revert to old behavior. Please see:\n\t// Please see https://github.com/dewrich/oapi-codegen/issues/549\n\tOldEnumConflicts bool `yaml:\"old-enum-conflicts,omitempty\"`\n\t// It was a mistake to generate a go type definition for every $ref in\n\t// the OpenAPI schema. New behavior uses type aliases where possible, but\n\t// this can generate code which breaks existing builds. Set OldAliasing to true\n\t// for old behavior.\n\t// Please see https://github.com/dewrich/oapi-codegen/issues/549\n\tOldAliasing bool `yaml:\"old-aliasing,omitempty\"`\n\t// When an object contains no members, and only an additionalProperties specification,\n\t// it is flattened to a map\n\tDisableFlattenAdditionalProperties bool `yaml:\"disable-flatten-additional-properties,omitempty\"`\n\t// When an object property is both required and readOnly the go model is generated\n\t// as a pointer. Set DisableRequiredReadOnlyAsPointer to true to mark them as non pointer.\n\t// Please see https://github.com/dewrich/oapi-codegen/issues/604\n\tDisableRequiredReadOnlyAsPointer bool `yaml:\"disable-required-readonly-as-pointer,omitempty\"`\n\t// When set to true, always prefix enum values with their type name instead of only\n\t// when typenames would be conflicting.\n\tAlwaysPrefixEnumValues bool `yaml:\"always-prefix-enum-values,omitempty\"`\n\t// Our generated code for Chi has historically inverted the order in which Chi middleware is\n\t// applied such that the last invoked middleware ends up executing first in the Chi chain\n\t// This resolves the behavior such that middlewares are chained in the order they are invoked.\n\t// Please see https://github.com/dewrich/oapi-codegen/issues/786\n\tApplyChiMiddlewareFirstToLast bool `yaml:\"apply-chi-middleware-first-to-last,omitempty\"`\n\t// Our generated code for gorilla/mux has historically inverted the order in which gorilla/mux middleware is\n\t// applied such that the last invoked middleware ends up executing first in the middlewares chain\n\t// This resolves the behavior such that middlewares are chained in the order they are invoked.\n\t// Please see https://github.com/dewrich/oapi-codegen/issues/841\n\tApplyGorillaMiddlewareFirstToLast bool `yaml:\"apply-gorilla-middleware-first-to-last,omitempty\"`\n\t// CircularReferenceLimit allows controlling the limit for circular reference checking.\n\t// In some OpenAPI specifications, we have a higher number of circular\n\t// references than is allowed out-of-the-box, but can be tuned to allow\n\t// traversing them.\n\t// Deprecated: In kin-openapi v0.126.0 (https://github.com/getkin/kin-openapi/tree/v0.126.0?tab=readme-ov-file#v01260) the Circular Reference Counter functionality was removed, instead resolving all references with backtracking, to avoid needing to provide a limit to reference counts.\n\tCircularReferenceLimit int `yaml:\"circular-reference-limit\"`\n\t// AllowUnexportedStructFieldNames makes it possible to output structs that have fields that are unexported.\n\t//\n\t// This is expected to be used in conjunction with `x-go-name` and `x-oapi-codegen-only-honour-go-name` to override the resulting output field name, and `x-oapi-codegen-extra-tags` to not produce JSON tags for `encoding/json`, such as:\n\t//\n\t//  ```yaml\n\t//   id:\n\t//     type: string\n\t//     x-go-name: accountIdentifier\n\t//     x-oapi-codegen-extra-tags:\n\t//       json: \"-\"\n\t//     x-oapi-codegen-only-honour-go-name: true\n\t//   ```\n\t//\n\t// NOTE that this can be confusing to users of your OpenAPI specification, who may see a field present and therefore be expecting to see/use it in the request/response, without understanding the nuance of how `oapi-codegen` generates the code.\n\tAllowUnexportedStructFieldNames bool `yaml:\"allow-unexported-struct-field-names\"`\n\n\t// PreserveOriginalOperationIdCasingInEmbeddedSpec ensures that the `operationId` from the source spec is kept intact in case when embedding it into the Embedded Spec output.\n\t// When `oapi-codegen` parses the original OpenAPI specification, it will apply the configured `output-options.name-normalizer` to each operation's `operationId` before that is used to generate code from.\n\t// However, this is also applied to the copy of the `operationId`s in the `embedded-spec` generation, which means that the embedded OpenAPI specification is then out-of-sync with the input specificiation.\n\t// To ensure that the `operationId` in the embedded spec is preserved as-is from the input specification, set this.\n\t// NOTE that this will not impact generated code.\n\t// NOTE that if you're using `include-operation-ids` or `exclude-operation-ids` you may want to ensure that the `operationId`s used are correct.\n\tPreserveOriginalOperationIdCasingInEmbeddedSpec bool `yaml:\"preserve-original-operation-id-casing-in-embedded-spec\"`\n\n\t// HeadersImplicitlyRequired treats all response headers as required, ignoring\n\t// the `required` property from the header definition. Prior to v2.6.0,\n\t// oapi-codegen generated all response headers as direct values (implicitly\n\t// required). The OpenAPI specification defaults headers to optional\n\t// (required: false), so the corrected behavior generates optional headers as\n\t// pointers. Set this to true to restore the old behavior where all headers\n\t// are treated as required.\n\t// Please see https://github.com/dewrich/oapi-codegen/issues/2267\n\tHeadersImplicitlyRequired bool `yaml:\"headers-implicitly-required,omitempty\"`\n}\n```\nCompatibilityOptions specifies backward compatibility settings for the code generator.\n\n```go\nfunc (co CompatibilityOptions) Validate() map[string]string\n```\n\n```go\ntype Configuration struct {\n\t// PackageName to generate the code under\n\tPackageName string `yaml:\"package\"`\n\t// Generate specifies which supported output formats to generate\n\tGenerate GenerateOptions `yaml:\"generate,omitempty\"`\n\t// CompatibilityOptions specifies backward compatibility settings for the code generator\n\tCompatibility CompatibilityOptions `yaml:\"compatibility,omitempty\"`\n\t// OutputOptions are used to modify the output code in some way.\n\tOutputOptions OutputOptions `yaml:\"output-options,omitempty\"`\n\t// ImportMapping specifies the golang package path for each external reference\n\tImportMapping map[string]string `yaml:\"import-mapping,omitempty\"`\n\t// AdditionalImports defines any additional Go imports to add to the generated code\n\tAdditionalImports []AdditionalImport `yaml:\"additional-imports,omitempty\"`\n\t// NoVCSVersionOverride allows overriding the version of the application for cases where no Version Control System (VCS) is available when building, for instance when using a Nix derivation.\n\t// See documentation for how to use it in examples/no-vcs-version-override/README.md\n\tNoVCSVersionOverride *string `yaml:\"-\"`\n}\n```\nConfiguration defines code generation customizations\n\n```go\nfunc (o Configuration) UpdateDefaults() Configuration\n```\nUpdateDefaults sets reasonable default values for unset fields in Configuration\n\n```go\nfunc (o Configuration) Validate() error\n```\nValidate checks whether Configuration represent a valid configuration\n\n```go\ntype Constants struct {\n\t// SecuritySchemeProviderNames holds all provider names for security schemes.\n\tSecuritySchemeProviderNames []string\n\t// EnumDefinitions holds type and value information for all enums\n\tEnumDefinitions []EnumDefinition\n\t// SkipEnumValidate suppresses generation of the `Valid()` method on\n\t// enum types. Mirrors OutputOptions.SkipEnumValidate.\n\tSkipEnumValidate bool\n}\n```\n\n```go\ntype Discriminator struct {\n\t// maps discriminator value to go type\n\tMapping map[string]string\n\n\t// JSON property name that holds the discriminator\n\tProperty string\n}\n```\n\n```go\nfunc (d *Discriminator) JSONTag() string\n```\n\n```go\nfunc (d *Discriminator) PropertyName() string\n```\n\n```go\ntype EnumDefinition struct {\n\t// Schema is the scheme of a type which has a list of enum values, eg, the\n\t// \"container\" of the enum.\n\tSchema Schema\n\t// TypeName is the name of the enum's type, usually aliased from something.\n\tTypeName string\n\t// ValueWrapper wraps the value. It's used to conditionally apply quotes\n\t// around strings.\n\tValueWrapper string\n\t// PrefixTypeName determines if the enum value is prefixed with its TypeName.\n\t// This is set to true when this enum conflicts with another in terms of\n\t// TypeNames or when explicitly requested via the\n\t// `compatibility.always-prefix-enum-values` option.\n\tPrefixTypeName bool\n}\n```\nEnumDefinition holds type information for enum\n\n```go\nfunc (e *EnumDefinition) GetValues() map[string]string\n```\nGetValues generates enum names in a way to minimize global conflicts\n\n```go\ntype FieldDescriptor struct {\n\tRequired bool   // Is the schema required? If not, we'll pass by pointer\n\tGoType   string // The Go type needed to represent the json type.\n\tGoName   string // The Go compatible type name for the type\n\tJsonName string // The json type name for the type\n\tIsRef    bool   // Is this schema a reference to predefined object?\n}\n```\n\n```go\ntype FormatMapping struct {\n\tDefault SimpleTypeSpec            `yaml:\"default\" json:\"default\"`\n\tFormats map[string]SimpleTypeSpec `yaml:\"formats,omitempty\" json:\"formats,omitempty\"`\n}\n```\nFormatMapping defines the default Go type and format-specific overrides for an OpenAPI type.\n\n```go\nfunc (fm FormatMapping) Resolve(format string) SimpleTypeSpec\n```\nResolve returns the SimpleTypeSpec for a given format string. If the format has a specific mapping, that is returned; otherwise the default is used.\n\n```go\ntype GatheredSchema struct {\n\tPath           SchemaPath\n\tContext        SchemaContext\n\tRef            string           // $ref string if this is a reference\n\tSchema         *openapi3.Schema // The resolved schema value\n\tOperationID    string           // Enclosing operation's ID, if any\n\tContentType    string           // Media type, if from request/response body\n\tStatusCode     string           // HTTP status code, if from a response\n\tParamIndex     int              // Parameter index within an operation\n\tComponentName  string           // The component name (e.g., \"Bar\" for components/schemas/Bar)\n\tGoNameOverride string           // x-go-name override from the component or its parent container\n}\n```\nGatheredSchema represents a schema discovered during the gather pass, along with its document location and context metadata.\n\n```go\nfunc GatherSchemas(spec *openapi3.T, opts Configuration) []*GatheredSchema\n```\nGatherSchemas walks the entire OpenAPI spec and collects all schemas that will need Go type names. This is the first pass of the multi-pass resolution.\n\n```go\nfunc (gs *GatheredSchema) FormatPath() string\n```\nFormatPath returns a human-readable representation of the path for debugging.\n\n```go\nfunc (gs *GatheredSchema) IsComponentSchema() bool\n```\nIsComponentSchema returns true if this schema came from components/schemas.\n\n```go\ntype GenerateOptions struct {\n\t// IrisServer specifies whether to generate iris server boilerplate\n\tIrisServer bool `yaml:\"iris-server,omitempty\"`\n\t// ChiServer specifies whether to generate chi server boilerplate\n\tChiServer bool `yaml:\"chi-server,omitempty\"`\n\t// FiberServer specifies whether to generate fiber server boilerplate\n\tFiberServer bool `yaml:\"fiber-server,omitempty\"`\n\t// EchoServer specifies whether to generate echo server boilerplate\n\tEchoServer bool `yaml:\"echo-server,omitempty\"`\n\t// Echo5Server specifies whether to generate echo v5 server boilerplate\n\tEcho5Server bool `yaml:\"echo5-server,omitempty\"`\n\t// GinServer specifies whether to generate gin server boilerplate\n\tGinServer bool `yaml:\"gin-server,omitempty\"`\n\t// GorillaServer specifies whether to generate Gorilla server boilerplate\n\tGorillaServer bool `yaml:\"gorilla-server,omitempty\"`\n\t// StdHTTPServer specifies whether to generate stdlib http server boilerplate\n\tStdHTTPServer bool `yaml:\"std-http-server,omitempty\"`\n\t// Strict specifies whether to generate strict server wrapper\n\tStrict bool `yaml:\"strict-server,omitempty\"`\n\t// Client specifies whether to generate client boilerplate\n\tClient bool `yaml:\"client,omitempty\"`\n\t// Models specifies whether to generate type definitions\n\tModels bool `yaml:\"models,omitempty\"`\n\t// EmbeddedSpec indicates whether to embed the swagger spec in the generated code\n\tEmbeddedSpec bool `yaml:\"embedded-spec,omitempty\"`\n\t// ServerURLs generates types for the `Server` definitions' URLs, instead of needing to provide your own values\n\tServerURLs bool `yaml:\"server-urls,omitempty\"`\n}\n```\nGenerateOptions specifies which supported output formats to generate.\n\n```go\nfunc (g GenerateOptions) RouterImports() []AdditionalImport\n```\nRouterImports returns the framework-specific and strict middleware imports needed based on which server type is selected.\n\n```go\nfunc (oo GenerateOptions) Validate() map[string]string\n```\n\n```go\nfunc (oo GenerateOptions) Warnings() map[string]string\n```\n\n```go\ntype NameNormalizer func(string) string\n```\nNameNormalizer is a function that takes a type name, and returns that type name converted into a different format.\n\nThis may be an Operation ID i.e. \\`retrieveUserRequests\\` or a Schema name i.e. \\`BigBlockOfCheese\\`\n\nNOTE: this must return a string that can be used as a valid Go type name\n\n```go\ntype NameNormalizerFunction string\n```\n\n```go\nconst (\n\t// NameNormalizerFunctionUnset is the default case, where the `name-normalizer` option hasn't been set. This will use the `ToCamelCase` function.\n\t//\n\t// See the docs for `NameNormalizerFunctionToCamelCase` for more details.\n\tNameNormalizerFunctionUnset NameNormalizerFunction = \"\"\n\t// NameNormalizerFunctionToCamelCase will use the `ToCamelCase` function.\n\t//\n\t// For instance:\n\t//\n\t// - `getHttpPet`   =\u003e `GetHttpPet`\n\t// - `OneOf2things` =\u003e `OneOf2things`\n\tNameNormalizerFunctionToCamelCase NameNormalizerFunction = \"ToCamelCase\"\n\t// NameNormalizerFunctionToCamelCaseWithDigits will use the `NameNormalizerFunctionToCamelCaseWithDigits` function.\n\t//\n\t// For instance:\n\t//\n\t// - `getHttpPet`   =\u003e `GetHttpPet`\n\t// - `OneOf2things` =\u003e `OneOf2Things`\n\tNameNormalizerFunctionToCamelCaseWithDigits NameNormalizerFunction = \"ToCamelCaseWithDigits\"\n\t// NameNormalizerFunctionToCamelCaseWithInitialisms will use the `NameNormalizerFunctionToCamelCaseWithInitialisms` function.\n\t//\n\t// For instance:\n\t//\n\t// - `getHttpPet`   =\u003e `GetHTTPPet`\n\t// - `OneOf2things` =\u003e `OneOf2things`\n\tNameNormalizerFunctionToCamelCaseWithInitialisms NameNormalizerFunction = \"ToCamelCaseWithInitialisms\"\n)\n```\n\n```go\ntype NameNormalizerMap map[NameNormalizerFunction]NameNormalizer\n```\n\n```go\nfunc (m NameNormalizerMap) Options() []string\n```\n\n```go\ntype OperationDefinition struct {\n\t// OperationId is the `operationId` field from the OpenAPI Specification, after going through a `nameNormalizer`, and will be used to generate function names\n\tOperationId string\n\t// SpecOperationId is the raw `operationId` value as it appears in the OpenAPI spec, before normalization to a Go identifier. Empty when the spec didn't supply one (in which case the codegen-generated ID is the only available identifier and is exposed via OperationId).\n\tSpecOperationId string\n\n\tPathParams          []ParameterDefinition // Parameters in the path, eg, /path/:param\n\tHeaderParams        []ParameterDefinition // Parameters in HTTP headers\n\tQueryParams         []ParameterDefinition // Parameters in the query, /path?param\n\tCookieParams        []ParameterDefinition // Parameters in cookies\n\tTypeDefinitions     []TypeDefinition      // These are all the types we need to define for this operation\n\tSecurityDefinitions []SecurityDefinition  // These are the security providers\n\tBodyRequired        bool\n\tBodies              []RequestBodyDefinition // The list of bodies for which to generate handlers.\n\tResponses           []ResponseDefinition    // The list of responses that can be accepted by handlers.\n\tSummary             string                  // Summary string from Swagger, used to generate a comment\n\tMethod              string                  // GET, POST, DELETE, etc.\n\tPath                string                  // The Swagger path for the operation, like /resource/{id}\n\tSpec                *openapi3.Operation\n\tIsAlias             bool   // True when this path is a $ref alias of another path item\n\tAliasTarget         string // When IsAlias is true, this is the OperationId of the canonical operation (for route registration to reference the correct wrapper)\n\tPathItemRef         string // The path item's $ref (if any); used to qualify externally-loaded schemas referenced from this operation's responses\n}\n```\nOperationDefinition describes an Operation\n\n```go\nfunc OperationDefinitions(swagger *openapi3.T) ([]OperationDefinition, error)\n```\nOperationDefinitions returns all operations for a swagger definition.\n\n```go\nfunc (o *OperationDefinition) AllParams() []ParameterDefinition\n```\nAllParams returns all parameters\n\n```go\nfunc (o *OperationDefinition) GetResponseTypeDefinitions() ([]ResponseTypeDefinition, error)\n```\nGetResponseTypeDefinitions produces a list of type definitions for a given Operation for the response types which we know how to parse. These will be turned into fields on a response object for automatic deserialization of responses in the generated Client code. See \"client-with-responses.tmpl\".\n\n```go\nfunc (o *OperationDefinition) HandlerName() string\n```\nHandlerName returns the OperationId to use when referencing the server-side wrapper function. For alias operations this is the canonical operation's ID, since the alias doesn't generate its own wrapper.\n\n```go\nfunc (o *OperationDefinition) HasBody() bool\n```\nHasBody is called by the template engine to determine whether to generate body marshaling code on the client. This is true for all body types, whether we generate types for them.\n\n```go\nfunc (o *OperationDefinition) HasMaskedRequestContentTypes() bool\n```\n\n```go\nfunc (o *OperationDefinition) MiddlewareKey() string\n```\nMiddlewareKey returns the identifier to use as the key in per-operation middleware maps. The raw spec OperationId is preferred so map keys mirror the OpenAPI spec verbatim; falls back to the normalized OperationId when the spec didn't supply one.\n\n```go\nfunc (o *OperationDefinition) Params() []ParameterDefinition\n```\nParams returns the list of all parameters except Path parameters. Path parameters are handled differently from the rest, since they're mandatory.\n\n```go\nfunc (o *OperationDefinition) RequiresParamObject() bool\n```\nIf we have parameters other than path parameters, they're bundled into an object. Returns true if we have any of those. This is used from the template engine.\n\n```go\nfunc (o *OperationDefinition) SummaryAsComment() string\n```\nSummaryAsComment returns the Operations summary as a multi line comment\n\n```go\ntype OutputOptions struct {\n\t// Whether to skip go imports on the generated code\n\tSkipFmt bool `yaml:\"skip-fmt,omitempty\"`\n\t// Whether to skip pruning unused components on the generated code\n\tSkipPrune bool `yaml:\"skip-prune,omitempty\"`\n\t// SkipEnumValidate disables the generation of the `Valid()` method on\n\t// enum types. By default each generated enum type includes a `Valid()\n\t// bool` method which returns true when the value matches one of the\n\t// defined constants; set this to true to suppress that method when it\n\t// conflicts with user-defined methods of the same name.\n\tSkipEnumValidate bool `yaml:\"skip-enum-validate,omitempty\"`\n\t// Only include operations that have one of these tags. Ignored when empty.\n\tIncludeTags []string `yaml:\"include-tags,omitempty\"`\n\t// Exclude operations that have one of these tags. Ignored when empty.\n\tExcludeTags []string `yaml:\"exclude-tags,omitempty\"`\n\t// Only include operations that have one of these operation-ids. Ignored when empty.\n\tIncludeOperationIDs []string `yaml:\"include-operation-ids,omitempty\"`\n\t// Exclude operations that have one of these operation-ids. Ignored when empty.\n\tExcludeOperationIDs []string `yaml:\"exclude-operation-ids,omitempty\"`\n\t// Override built-in templates from user-provided files\n\tUserTemplates map[string]string `yaml:\"user-templates,omitempty\"`\n\n\t// Exclude from generation schemas with given names. Ignored when empty.\n\tExcludeSchemas []string `yaml:\"exclude-schemas,omitempty\"`\n\t// The suffix used for responses types\n\tResponseTypeSuffix string `yaml:\"response-type-suffix,omitempty\"`\n\t// Override the default generated client type with the value\n\tClientTypeName string `yaml:\"client-type-name,omitempty\"`\n\t// AdditionalInitialisms is a list of additional initialisms to use when generating names.\n\t// NOTE that this has no effect unless the `name-normalizer` is set to `ToCamelCaseWithInitialisms`\n\tAdditionalInitialisms []string `yaml:\"additional-initialisms,omitempty\"`\n\t// StreamingContentTypes are regex patterns matched against response\n\t// Content-Type to decide when to generate a flush-per-chunk streaming\n\t// response path. User-provided patterns are merged with the defaults\n\t// (text/event-stream, application/jsonl, application/x-ndjson); invalid\n\t// regexes fail Validate().\n\tStreamingContentTypes []string `yaml:\"streaming-content-types,omitempty\"`\n\t// Whether to generate nullable type for nullable fields\n\tNullableType bool `yaml:\"nullable-type,omitempty\"`\n\n\t// DisableTypeAliasesForType allows defining which OpenAPI `type`s will explicitly not use type aliases\n\t// Currently supports:\n\t//   \"array\"\n\tDisableTypeAliasesForType []string `yaml:\"disable-type-aliases-for-type\"`\n\n\t// SkipResponseBodyGetters decides whether to generate getter methods for response bodies.\n\tSkipResponseBodyGetters bool `yaml:\"skip-response-body-getters,omitempty\"`\n\n\t// NameNormalizer is the method used to normalize Go names and types, for instance converting the text `MyApi` to `MyAPI`. Corresponds with the constants defined for `codegen.NameNormalizerFunction`\n\tNameNormalizer string `yaml:\"name-normalizer,omitempty\"`\n\n\t// Overlay defines configuration for the OpenAPI Overlay (https://github.com/OAI/Overlay-Specification) to manipulate the OpenAPI specification before generation. This allows modifying the specification without needing to apply changes directly to it, making it easier to keep it up-to-date.\n\tOverlay OutputOptionsOverlay `yaml:\"overlay\"`\n\n\t// EnableYamlTags adds YAML tags to generated structs, in addition to default JSON ones\n\tEnableYamlTags bool `yaml:\"yaml-tags,omitempty\"`\n\n\t// ClientResponseBytesFunction decides whether to enable the generation of a `Bytes()` method on response objects for `ClientWithResponses`\n\tClientResponseBytesFunction bool `yaml:\"client-response-bytes-function,omitempty\"`\n\n\t// SkipClientResponseContentType disables the generation of a `ContentType()` method on response objects for `ClientWithResponses`, which is otherwise generated by default.\n\tSkipClientResponseContentType bool `yaml:\"skip-client-response-content-type,omitempty\"`\n\n\t// PreferSkipOptionalPointer allows defining at a global level whether to omit the pointer for a type to indicate that the field/type is optional.\n\t// This is the same as adding `x-go-type-skip-optional-pointer` to each field (manually, or using an OpenAPI Overlay)\n\tPreferSkipOptionalPointer bool `yaml:\"prefer-skip-optional-pointer,omitempty\"`\n\n\t// PreferSkipOptionalPointerWithOmitzero allows generating the `omitzero` JSON tag types that would have had an optional pointer.\n\t// This is the same as adding `x-omitzero` to each field (manually, or using an OpenAPI Overlay).\n\t// A field can set `x-omitzero: false` to disable the `omitzero` JSON tag.\n\t// NOTE that this must be used alongside `prefer-skip-optional-pointer`, otherwise makes no difference.\n\tPreferSkipOptionalPointerWithOmitzero bool `yaml:\"prefer-skip-optional-pointer-with-omitzero,omitempty\"`\n\n\t// PreferSkipOptionalPointerOnContainerTypes allows disabling the generation of an \"optional pointer\" for an optional field that is a container type (such as a slice or a map), which ends up requiring an additional, unnecessary, `... != nil` check\n\tPreferSkipOptionalPointerOnContainerTypes bool `yaml:\"prefer-skip-optional-pointer-on-container-types,omitempty\"`\n\n\t// ResolveTypeNameCollisions, when set to true, automatically renames\n\t// types that collide across different OpenAPI component sections\n\t// (schemas, parameters, requestBodies, responses, headers) by appending\n\t// a suffix based on the component section (e.g., \"Parameter\", \"Response\",\n\t// \"RequestBody\"). It also detects collisions between component types and\n\t// client response wrapper types (e.g., issue #1474). Without this, the\n\t// codegen will error on duplicate type names, requiring manual resolution\n\t// via x-go-name.\n\tResolveTypeNameCollisions bool `yaml:\"resolve-type-name-collisions,omitempty\"`\n\n\t// TypeMapping allows customizing OpenAPI type/format to Go type mappings.\n\t// User-specified mappings are merged on top of the defaults.\n\tTypeMapping *TypeMapping `yaml:\"type-mapping,omitempty\"`\n}\n```\nOutputOptions are used to modify the output code in some way.\n\n```go\nfunc (oo OutputOptions) Validate() map[string]string\n```\n\n```go\ntype OutputOptionsOverlay struct {\n\tPath string `yaml:\"path\"`\n\n\t// Strict defines whether the Overlay should be applied in a strict way, highlighting any actions that will not take any effect. This can, however, lead to more work when testing new actions in an Overlay, so can be turned off with this setting.\n\t// Defaults to true.\n\tStrict *bool `yaml:\"strict,omitempty\"`\n}\n```\n\n```go\ntype ParameterDefinition struct {\n\tParamName string // The original json parameter name, eg param_name\n\tIn        string // Where the parameter is defined - path, header, cookie, query\n\tRequired  bool   // Is this a required parameter?\n\tSpec      *openapi3.Parameter\n\tSchema    Schema\n}\n```\n\n```go\nfunc CombineOperationParameters(globalParams []ParameterDefinition, localParams []ParameterDefinition) ([]ParameterDefinition, error)\n```\nCombineOperationParameters combines the Parameters defined at a global level (Parameters defined for all methods on a given path) with the Parameters defined at a local level (Parameters defined for a specific path), preferring the locally defined parameter over the global one\n\n```go\nfunc DescribeParameters(params openapi3.Parameters, path []string) ([]ParameterDefinition, error)\n```\nDescribeParameters walks the given parameters dictionary, and generates the above descriptors into a flat list. This makes it a lot easier to traverse the data in the template engine.\n\n```go\nfunc FilterParameterDefinitionByType(params []ParameterDefinition, in string) []ParameterDefinition\n```\nFilterParameterDefinitionByType returns the subset of the specified parameters which are of the specified type.\n\n```go\nfunc SortParamsByPath(path string, in []ParameterDefinition) ([]ParameterDefinition, error)\n```\nSortParamsByPath reorders the given parameter definitions to match those in the path URI. If a parameter appears more than once in the path (e.g. Keycloak's /clients/{client-uuid}/roles/{role-name}/composites/clients/{client-uuid}), duplicates are removed and only the first occurrence determines the order.\n\n```go\nfunc (pd *ParameterDefinition) Explode() bool\n```\n\n```go\nfunc (pd ParameterDefinition) GoName() string\n```\n\n```go\nfunc (pd ParameterDefinition) GoVariableName() string\n```\n\n```go\nfunc (pd ParameterDefinition) HasOptionalPointer() bool\n```\nHasOptionalPointer indicates whether the generated property has an optional pointer associated with it. This takes into account the \\`x-go-type-skip-optional-pointer\\` extension, allowing a parameter definition to control whether the pointer should be skipped.\n\n```go\nfunc (pd ParameterDefinition) IndirectOptional() bool\n```\nDeprecated: Use HasOptionalPointer, as it is clearer what the intent is.\n\n```go\nfunc (pd *ParameterDefinition) IsJson() bool\n```\n\n```go\nfunc (pd *ParameterDefinition) IsPassThrough() bool\n```\n\n```go\nfunc (pd *ParameterDefinition) IsStyled() bool\n```\n\n```go\nfunc (pd *ParameterDefinition) JsonTag() string\n```\nJsonTag generates the JSON annotation to map GoType to json type name. If Parameter Foo is marshaled to json as \"foo\", this will create the annotation 'json:\"foo\"' It also includes any additional struct tags from x-oapi-codegen-extra-tags at the parameter or schema level (parameter-level takes precedence).\n\n```go\nfunc (pd ParameterDefinition) RequiresNilCheck() bool\n```\nRequiresNilCheck indicates whether the generated property should have a nil check performed on it before other checks. This should be used in templates when performing \\`nil\\` checks, but NOT when i.e. determining if there should be an optional pointer given to the type - in that case, use \\`HasOptionalPointer\\`\n\n```go\nfunc (pd ParameterDefinition) SanitizedParamName() string\n```\nSanitizedParamName returns the parameter name sanitized to be a valid Go identifier. This is needed for routers like net/http's ServeMux where path wildcards (e.g. {name}) must be valid Go identifiers. For the original OpenAPI parameter name (e.g. for error messages or JSON tags), use ParamName.\n\n```go\nfunc (pd *ParameterDefinition) SchemaFormat() string\n```\nSchemaFormat returns the OpenAPI format string for this parameter's schema (e.g. \"byte\", \"date-time\"), or empty string if unavailable.\n\n```go\nfunc (pd *ParameterDefinition) SchemaType() string\n```\nSchemaType returns the first OpenAPI type string for this parameter's schema (e.g. \"string\", \"integer\"), or empty string if unavailable.\n\n```go\nfunc (pd *ParameterDefinition) Style() string\n```\n\n```go\nfunc (pd ParameterDefinition) TypeDef() string\n```\nTypeDef is here as an adapter after a large refactoring so that I don't have to update all the templates. It returns the type definition for a parameter, without the leading '\\*' for optional ones.\n\n```go\nfunc (pd ParameterDefinition) ZeroValueIsNil() bool\n```\nZeroValueIsNil is a helper function to determine if the given Go type used for this property has \\`nil\\` as its Go zero value. Slices (OpenAPI \\`array\\`) and maps (OpenAPI \\`object\\` with only \\`additionalProperties\\`, rendered as \\`map\\[K]V\\`) both satisfy this — templates use it to decide whether to emit a nil-check before reading the field.\n\n```go\ntype ParameterDefinitions []ParameterDefinition\n```\n\n```go\nfunc (p ParameterDefinitions) FindByName(name string) *ParameterDefinition\n```\n\n```go\ntype Property struct {\n\tDescription   string\n\tJsonFieldName string\n\tSchema        Schema\n\tRequired      bool\n\tNullable      bool\n\tReadOnly      bool\n\tWriteOnly     bool\n\tNeedsFormTag  bool\n\tExtensions    map[string]any\n\tDeprecated    bool\n}\n```\n\n```go\nfunc (p Property) GoFieldName() string\n```\n\n```go\nfunc (p Property) GoTypeDef() string\n```\n\n```go\nfunc (p Property) HasOptionalPointer() bool\n```\nHasOptionalPointer indicates whether the generated property has an optional pointer associated with it. This takes into account the \\`x-go-type-skip-optional-pointer\\` extension, allowing a parameter definition to control whether the pointer should be skipped.\n\n```go\nfunc (p Property) RequiresNilCheck() bool\n```\nRequiresNilCheck indicates whether the generated property should have a nil check performed on it before other checks. This should be used in templates when performing \\`nil\\` checks, but NOT when i.e. determining if there should be an optional pointer given to the type - in that case, use \\`HasOptionalPointer\\`\n\n```go\nfunc (p Property) ZeroValueIsNil() bool\n```\nZeroValueIsNil is a helper function to determine if the given Go type used for this property has \\`nil\\` as its Go zero value. Slices (OpenAPI \\`array\\`) and maps (OpenAPI \\`object\\` with only \\`additionalProperties\\`, rendered as \\`map\\[K]V\\`) both satisfy this — the custom-marshal templates use it to decide whether to emit a nil-check before reading the field.\n\n```go\ntype RefWrapper struct {\n\tRef       string\n\tHasValue  bool\n\tSourceRef any\n}\n```\n\n```go\ntype RequestBodyDefinition struct {\n\t// Is this body required, or optional?\n\tRequired bool\n\n\t// This is the schema describing this body\n\tSchema Schema\n\n\t// When we generate type names, we need a Tag for it, such as JSON, in\n\t// which case we will produce \"JSONBody\".\n\tNameTag string\n\n\t// This is the content type corresponding to the body, eg, application/json\n\tContentType string\n\n\t// Whether this is the default body type. For an operation named OpFoo, we\n\t// will not add suffixes like OpFooJSONBody for this one.\n\tDefault bool\n\n\t// Contains encoding options for formdata\n\tEncoding map[string]RequestBodyEncoding\n}\n```\nRequestBodyDefinition describes a request body\n\n```go\nfunc (r RequestBodyDefinition) CustomType() bool\n```\nCustomType returns whether the body is a custom inline type, or pre-defined. This is poorly named, but it's here for compatibility reasons post-refactoring TODO: clean up the templates code, it can be simpler.\n\n```go\nfunc (r RequestBodyDefinition) IsFixedContentType() bool\n```\nIsFixedContentType returns true if content type has fixed content type, i.e. contains no \"\\*\" symbol\n\n```go\nfunc (r RequestBodyDefinition) IsJSON() bool\n```\nIsJSON returns whether this is a JSON media type, for instance: - application/json - application/vnd.api+json - application/\\*+json\n\n```go\nfunc (r RequestBodyDefinition) IsSupported() bool\n```\nIsSupported returns true if we support this content type for server. Otherwise io.Reader will be generated\n\n```go\nfunc (r RequestBodyDefinition) IsSupportedByClient() bool\n```\nIsSupportedByClient returns true if we support this content type for client. Otherwise only generic method will ge generated\n\n```go\nfunc (r RequestBodyDefinition) Suffix() string\n```\nWhen we're generating multiple functions which relate to request bodies, this generates the suffix. Such as Operation DoFoo would be suffixed with DoFooWithXMLBody.\n\n```go\nfunc (r RequestBodyDefinition) TypeDef(opID string) *TypeDefinition\n```\nTypeDef returns the Go type definition for a request body\n\n```go\ntype RequestBodyEncoding struct {\n\tContentType string\n\tStyle       string\n\tExplode     *bool\n}\n```\n\n```go\ntype ResolvedName struct {\n\tSchema    *GatheredSchema\n\tGoName    string // The resolved Go type name\n\tCandidate string // The initial candidate name before collision resolution\n\tPinned    bool   // True if name came from x-go-name; must not be renamed\n}\n```\nResolvedName holds the final Go type name assigned to a gathered schema.\n\n```go\ntype ResponseContentDefinition struct {\n\t// This is the schema describing this content\n\tSchema Schema\n\n\t// This is the content type corresponding to the body, eg, application/json\n\tContentType string\n\n\t// When we generate type names, we need a Tag for it, such as JSON, in\n\t// which case we will produce \"Response200JSONContent\".\n\tNameTag string\n}\n```\n\n```go\nfunc (r ResponseContentDefinition) HasFixedContentType() bool\n```\nHasFixedContentType returns true if content type has fixed content type, i.e. contains no \"\\*\" symbol\n\n```go\nfunc (r ResponseContentDefinition) IsJSON() bool\n```\nIsJSON returns whether this is a JSON media type, for instance: - application/json - application/vnd.api+json - application/\\*+json\n\n```go\nfunc (r ResponseContentDefinition) IsStreamingContentType() bool\n```\nIsStreamingContentType reports whether this response's media type matches any configured streaming-content-types pattern (defaults merged with OutputOptions.StreamingContentTypes). Templates use this to emit a flush-per-chunk streaming path instead of a buffered io.Copy.\n\n```go\nfunc (r ResponseContentDefinition) IsSupported() bool\n```\n\n```go\nfunc (r ResponseContentDefinition) NameTagOrContentType() string\n```\n\n```go\nfunc (r ResponseContentDefinition) TypeDef(opID string, statusCode int) *TypeDefinition\n```\nTypeDef returns the Go type definition for a request body\n\n```go\ntype ResponseDefinition struct {\n\tStatusCode  string\n\tDescription string\n\tContents    []ResponseContentDefinition\n\tHeaders     []ResponseHeaderDefinition\n\tRef         string\n}\n```\n\n```go\nfunc GenerateResponseDefinitions(operationID string, responses map[string]*openapi3.ResponseRef, pathItemRef string) ([]ResponseDefinition, error)\n```\n\n```go\nfunc (r ResponseDefinition) GoName() string\n```\n\n```go\nfunc (r ResponseDefinition) HasFixedStatusCode() bool\n```\n\n```go\nfunc (r ResponseDefinition) IsExternalRef() bool\n```\n\n```go\nfunc (r ResponseDefinition) IsRef() bool\n```\n\n```go\ntype ResponseHeaderDefinition struct {\n\tName     string\n\tGoName   string\n\tSchema   Schema\n\tRequired bool\n\tNullable bool\n}\n```\n\n```go\nfunc (h ResponseHeaderDefinition) GoTypeDef() string\n```\nGoTypeDef returns the Go type string for this header, applying pointer or nullable wrapping based on the Required/Nullable fields and global config.\n\n```go\nfunc (h ResponseHeaderDefinition) IsNullable() bool\n```\nIsNullable returns true if the header type uses nullable.Nullable\\[T] rather than a pointer for optionality.\n\n```go\nfunc (h ResponseHeaderDefinition) IsOptional() bool\n```\nIsOptional returns true if this header's Go type is indirect (pointer or nullable wrapper), meaning the template should guard before calling w.Header().Set(). This must stay in sync with GoTypeDef().\n\n```go\ntype ResponseTypeDefinition struct {\n\tTypeDefinition\n\t// The content type name where this is used, eg, application/json\n\tContentTypeName string\n\n\t// The type name of a response model.\n\tResponseName string\n\n\tAdditionalTypeDefinitions []TypeDefinition\n}\n```\nResponseTypeDefinition is an extension of TypeDefinition, specifically for response unmarshaling in ClientWithResponses.\n\n```go\ntype Schema struct {\n\tGoType  string // The Go type needed to represent the schema\n\tRefType string // If the type has a type name, this is set\n\n\tArrayType *Schema // The schema of array element\n\n\tEnumValues map[string]string // Enum values\n\n\tProperties               []Property       // For an object, the fields with names\n\tHasAdditionalProperties  bool             // Whether we support additional properties\n\tAdditionalPropertiesType *Schema          // And if we do, their type\n\tAdditionalTypes          []TypeDefinition // We may need to generate auxiliary helper types, stored here\n\n\tSkipOptionalPointer bool // Some types don't need a * in front when they're optional\n\n\tDescription string // The description of the element\n\n\tUnionElements []UnionElement // Possible elements of oneOf/anyOf union\n\tDiscriminator *Discriminator // Describes which value is stored in a union\n\n\t// If this is set, the schema will declare a type via alias, eg,\n\t// `type Foo = bool`. If this is not set, we will define this type via\n\t// type definition `type Foo bool`\n\t//\n\t// Can be overriden by the OutputOptions#DisableTypeAliasesForType field\n\tDefineViaAlias bool\n\n\t// The original OpenAPIv3 Schema.\n\tOAPISchema *openapi3.Schema\n}\n```\nSchema describes an OpenAPI schema, with lots of helper fields to use in the templating engine.\n\n```go\nfunc GenerateGoSchema(sref *openapi3.SchemaRef, path []string) (Schema, error)\n```\n\n```go\nfunc MergeSchemas(allOf []*openapi3.SchemaRef, path []string) (Schema, error)\n```\nMergeSchemas merges all the fields in the schemas supplied into one giant schema. The idea is that we merge all fields together into one schema.\n\n```go\nfunc (s *Schema) AddProperty(p Property) error\n```\nAddProperty adds a new property to the current Schema, and returns an error if it collides. Two identical fields will not collide, but two properties by the same name, but different definition, will collide. It's safe to merge the fields of two schemas with overlapping properties if those properties are identical.\n\n```go\nfunc (s Schema) GetAdditionalTypeDefs() []TypeDefinition\n```\n\n```go\nfunc (s Schema) HasCustomMarshalJSON() bool\n```\nHasCustomMarshalJSON reports whether using this schema position as an underlying type of a named defined type (e.g. \\`type X Event\\` where Event is a oneOf union defined in components.schemas) would lose a custom MarshalJSON/UnmarshalJSON that we need to delegate to. This is true when the schema is a $ref to a oneOf/anyOf union defined elsewhere.\n\nFor \\*local\\* inline unions it is deliberately false: those are generated by emitting the union struct at this schema position, with its own MarshalJSON. The template's existing $hasUnionElements branch handles encoding by writing .union directly, so no delegation is needed.\n\nFor \\*external\\* inline unions (the response-root hoist set RefType to a type living in an imported package), the strict envelope is rendered as a defined type — \\`type X externalRef0.Y\\` — and methods on Y don't transfer. The .union shortcut also can't reach across packages. So we still need the MarshalJSON delegator here, even though UnionElements is non-empty.\n\n```go\nfunc (s Schema) IsExternalRef() bool\n```\n\n```go\nfunc (s Schema) IsPrimitive() bool\n```\nIsPrimitive returns true if the schema represents a primitive OpenAPI type (string, integer, number, or boolean) as opposed to an object, array, or composed type.\n\n```go\nfunc (s Schema) IsRef() bool\n```\n\n```go\nfunc (s Schema) TypeDecl() string\n```\n\n```go\ntype SchemaContext int\n```\nSchemaContext identifies where in the OpenAPI document a schema was found.\n\n```go\nconst (\n\tContextComponentSchema SchemaContext = iota\n\tContextComponentParameter\n\tContextComponentRequestBody\n\tContextComponentResponse\n\tContextComponentHeader\n\tContextOperationParameter\n\tContextOperationRequestBody\n\tContextOperationResponse\n\tContextClientResponseWrapper\n)\n```\n\n```go\nfunc (sc SchemaContext) String() string\n```\nString returns a human-readable name for the context.\n\n```go\nfunc (sc SchemaContext) Suffix() string\n```\nSuffix returns the suffix to use for collision resolution.\n\n```go\ntype SchemaDescriptor struct {\n\tFields                   []FieldDescriptor\n\tHasAdditionalProperties  bool\n\tAdditionalPropertiesType string\n}\n```\nSchemaDescriptor describes a Schema, a type definition.\n\n```go\ntype SchemaPath []string\n```\nSchemaPath represents the document location of a schema, e.g. \\[\"components\", \"schemas\", \"Pet\", \"properties\", \"name\"].\n\n```go\nfunc (sp SchemaPath) String() string\n```\nString returns the path joined with \"/\".\n\n```go\ntype SecurityDefinition struct {\n\tProviderName string\n\tScopes       []string\n}\n```\n\n```go\nfunc DescribeSecurityDefinition(securityRequirements openapi3.SecurityRequirements) []SecurityDefinition\n```\n\n```go\ntype ServerObjectDefinition struct {\n\t// GoName is the name of the variable for this Server URL\n\tGoName string\n\n\t// OAPISchema is the underlying OpenAPI representation of the Server\n\tOAPISchema *openapi3.Server\n}\n```\nServerObjectDefinition defines the definition of an OpenAPI Server object ([https://spec.openapis.org/oas/v3.0.3#server-object](https://spec.openapis.org/oas/v3.0.3#server-object)) as it is provided to code generation in \\`oapi-codegen\\`\n\n```go\nfunc (s ServerObjectDefinition) EnumDefaultPointers() []ServerURLDefaultPointer\n```\nEnumDefaultPointers returns one entry per enum-typed used variable with a \\`default\\` set. The template iterates this directly rather than recomputing identifier names from \\`$v.Default\\`.\n\n```go\nfunc (s ServerObjectDefinition) NewServerFunctionParams() string\n```\nNewServerFunctionParams returns the formatted parameter list for the generated \\`New\\\u003cServerName\u003e(...)\\` function — one typed parameter per declared-and-used variable, plus one \\`string\\` parameter per \\`{name}\\` placeholder that appears in the URL but isn't in \\`variables\\` (#2005). The two groups are sorted together alphabetically so the generated signature is deterministic.\n\nEquivalent to calling \\`genServerURLWithVariablesFunctionParams\\` for the typed half and concatenating the undeclared half — but exposing it as a method keeps server-urls.tmpl free of that combination logic and means the template helper itself stayed at its pre-existing two-argument shape (so any user-supplied custom \\`server-urls.tmpl\\` override that calls the helper directly is unaffected).\n\n```go\nfunc (s ServerObjectDefinition) UndeclaredPlaceholders() []string\n```\nUndeclaredPlaceholders returns the sorted list of \\`{name}\\` placeholder names that appear in OAPISchema.URL but have no corresponding entry in OAPISchema.Variables. The previous code generated a function that referenced only declared variables, so any undeclared placeholder remained in the URL after substitution and the trailing \\`{\\`/\\`}\\` runtime check tripped on every call — making the generated function permanently unusable ([https://github.com/dewrich/oapi-codegen/issues/2005](https://github.com/dewrich/oapi-codegen/issues/2005)). The template now adds these as plain \\`string\\` parameters so callers can fill them in directly.\n\n```go\nfunc (s ServerObjectDefinition) UsedVariables() map[string]*openapi3.ServerVariable\n```\nUsedVariables returns the subset of OAPISchema.Variables whose \\`{name}\\` placeholder actually appears in OAPISchema.URL. Variables declared but unused are skipped — they would otherwise produce a type, constant, function parameter, and a no-op \\`strings.ReplaceAll\\` ([https://github.com/dewrich/oapi-codegen/issues/2004](https://github.com/dewrich/oapi-codegen/issues/2004)). Used by both server-urls.tmpl and BuildServerURLTypeDefinitions so that emitted types and the generated function signature stay in sync.\n\n```go\ntype ServerURLDefaultPointer struct {\n\t// VariableName is the OpenAPI variable name (for doc comments).\n\tVariableName string\n\t// TypeName is the enum's Go type, e.g. `ServerUrlFooBarVariable`.\n\tTypeName string\n\t// PointerName is the constant being declared. Normally it is\n\t// `\u003cTypeName\u003eDefault` (matching the historical naming). Switches\n\t// to `\u003cTypeName\u003eDefaultValue` only when the variable's enum\n\t// contains a value whose identifier suffix is the literal string\n\t// \"Default\" — i.e. exactly the case that produced #2003's\n\t// duplicate-const compile error under the old codegen. Specs that\n\t// compiled cleanly before keep their `Default` name.\n\tPointerName string\n\t// TargetName is the fully-qualified enum-value constant that the\n\t// pointer references, e.g. `\u003cTypeName\u003eN443` or `\u003cTypeName\u003eFoo1`.\n\tTargetName string\n\t// Description is the variable's OpenAPI description (doc comment).\n\tDescription string\n}\n```\nServerURLDefaultPointer carries the pre-computed identifier names needed to emit a typed default-pointer constant for an enum-typed server-URL variable. Computed in Go (not the template) so that the pointer's reference to the enum-value constant always agrees with the identifier the const-block actually emitted, including in dedup-suffix cases (e.g. \\`enum: \\[\"foo\", \"FOO\"]\\` with \\`default: \"FOO\"\\` → enum const is \\`\\\u003cPrefix\u003eFoo1\\`, pointer must reference exactly that).\n\n```go\ntype SimpleTypeSpec struct {\n\tType   string `yaml:\"type\" json:\"type\"`\n\tImport string `yaml:\"import,omitempty\" json:\"import,omitempty\"`\n}\n```\nSimpleTypeSpec defines the Go type for an OpenAPI type/format combination, along with any import required to use it.\n\n```go\ntype TypeDefinition struct {\n\t// The name of the type, eg, type \u003c...\u003e Person\n\tTypeName string\n\n\t// The name of the corresponding JSON description, as it will sometimes\n\t// differ due to invalid characters.\n\tJsonName string\n\n\t// This is the Schema wrapper is used to populate the type description\n\tSchema Schema\n\n\t// ForceEnumPrefix, when true, forces the enum-value constants generated\n\t// from this TypeDefinition to be prefixed with the type name, regardless\n\t// of whether GenerateEnums detects a cross-enum conflict. Used for\n\t// synthesised enum types (e.g. server-URL variable enums) whose\n\t// generated identifiers must remain stable to avoid colliding with\n\t// other constants emitted alongside them.\n\tForceEnumPrefix bool\n}\n```\nTypeDefinition describes a Go type definition in generated code.\n\nLet's use this example schema: components:\n\n\tschemas:\n\t  Person:\n\t    type: object\n\t    properties:\n\t    name:\n\t      type: string\n\n```go\nfunc BuildServerURLTypeDefinitions(spec *openapi3.T) ([]TypeDefinition, error)\n```\nBuildServerURLTypeDefinitions synthesizes a TypeDefinition for every server-URL variable that defines an \\`enum\\`. These are appended into the same TypeDefinition slices used by GenerateTypes (typedef.tmpl) and GenerateEnums (constants.tmpl), so that server-URL enum variables get the same \\`type X string\\`, \\`const ( … )\\` block, and \\`Valid()\\` method as any other enum-bearing schema. The server-urls.tmpl template no longer emits these declarations directly.\n\nVariables without an \\`enum\\` are not handled here: server-urls.tmpl continues to emit their \\`type\\` and (optional) default constant inline, since the generic enum path has nothing to contribute for a non-enum string.\n\n```go\nfunc GenerateParamsTypes(op OperationDefinition) []TypeDefinition\n```\nGenerateParamsTypes defines the schema for a parameters definition object which encapsulates all the query, header and cookie parameters for an operation.\n\n```go\nfunc GenerateTypeDefsForOperation(op OperationDefinition) []TypeDefinition\n```\n\n```go\nfunc GenerateTypesForParameters(t *template.Template, params map[string]*openapi3.ParameterRef) ([]TypeDefinition, error)\n```\nGenerateTypesForParameters generates type definitions for any custom types defined in the components/parameters section of the Swagger spec.\n\n```go\nfunc GenerateTypesForRequestBodies(t *template.Template, bodies map[string]*openapi3.RequestBodyRef) ([]TypeDefinition, error)\n```\nGenerateTypesForRequestBodies generates type definitions for any custom types defined in the components/requestBodies section of the Swagger spec.\n\n```go\nfunc GenerateTypesForResponses(t *template.Template, responses openapi3.ResponseBodies) ([]TypeDefinition, error)\n```\nGenerateTypesForResponses generates type definitions for any custom types defined in the components/responses section of the Swagger spec.\n\n```go\nfunc GenerateTypesForSchemas(t *template.Template, schemas map[string]*openapi3.SchemaRef, excludeSchemas []string) ([]TypeDefinition, error)\n```\nGenerateTypesForSchemas generates type definitions for any custom types defined in the components/schemas section of the Swagger spec.\n\n```go\nfunc GenerateTypesForSecuritySchemes(t *template.Template, schemes map[string]*openapi3.SecuritySchemeRef) ([]TypeDefinition, error)\n```\nGenerateTypesForSecuritySchemes generates type definitions for any custom types defined in the components/securitySchemes section of the Swagger spec.\n\n```go\nfunc (t *TypeDefinition) IsAlias() bool\n```\n\n```go\ntype TypeMapping struct {\n\tInteger FormatMapping `yaml:\"integer,omitempty\" json:\"integer\"`\n\tNumber  FormatMapping `yaml:\"number,omitempty\" json:\"number\"`\n\tBoolean FormatMapping `yaml:\"boolean,omitempty\" json:\"boolean\"`\n\tString  FormatMapping `yaml:\"string,omitempty\" json:\"string\"`\n}\n```\nTypeMapping defines the mapping from OpenAPI types to Go types.\n\n```go\nfunc (base TypeMapping) Merge(user TypeMapping) TypeMapping\n```\nMerge returns a new TypeMapping with user overrides applied on top of base.\n\n```go\ntype UnionElement string\n```\nUnionElement describe union element, based on prefix externalRef\\\\d+ and real ref name from external schema.\n\n```go\nfunc (u UnionElement) Method() string\n```\nMethod generate union method name for template functions \\`As/From/Merge\\`.\n\n```go\nfunc (u UnionElement) String() string\n```\nString returns externalRef\\\\d+ and real ref name from external schema, like externalRef0.SomeType.\n\n","path":"github.com/dewrich/oapi-codegen/v2/pkg/codegen","name":"codegen","synopsis":"","isRedistributable":true}
