{"modulePath":"github.com/otto-eng/oapi-codegen","version":"v1.9.1","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 TemplateFunctions = template.FuncMap{\n\t\"genParamArgs\":               genParamArgs,\n\t\"genParamTypes\":              genParamTypes,\n\t\"genParamNames\":              genParamNames,\n\t\"genParamFmtString\":          ReplacePathParamsWithStr,\n\t\"swaggerUriToEchoUri\":        SwaggerUriToEchoUri,\n\t\"swaggerUriToChiUri\":         SwaggerUriToChiUri,\n\t\"swaggerUriToGinUri\":         SwaggerUriToGinUri,\n\t\"lcFirst\":                    LowercaseFirstCharacter,\n\t\"ucFirst\":                    UppercaseFirstCharacter,\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\":                      strings.Title,\n\t\"stripNewLines\":              stripNewLines,\n\t\"sanitizeGoIdentity\":         SanitizeGoIdentity,\n}\n```\nThis function map 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 EscapePathElements(path string) string\n```\nThis function 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```\nGiven a list of schema descriptors, produce corresponding field names with JSON annotations\n\n```go\nfunc GenStructFromAllOf(allOf []*openapi3.SchemaRef, path []string) (string, error)\n```\nThis function 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(swagger *openapi3.T, packageName string, opts Options) (string, error)\n```\nUses 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```\nGenerate 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) ([]RequestBodyDefinition, []TypeDefinition, error)\n```\nThis function turns the Swagger body definitions into a list of our body definitions which will be used for code generation.\n\n```go\nfunc GenerateChiServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateChiServer This function 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```\nUses 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```\nThis 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```\nGenerates operation ids, context keys, paths, etc. to be exported as constants\n\n```go\nfunc GenerateEchoServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateEchoServer This function 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 GenerateGinServer(t *template.Template, operations []OperationDefinition) (string, error)\n```\nGenerateGinServer This function 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) (string, error)\n```\nGenerate our import statements and package definition.\n\n```go\nfunc GenerateInlinedSpec(t *template.Template, importMapping importMap, swagger *openapi3.T) (string, error)\n```\nThis generates a gzipped, base64 encoded JSON representation of the swagger definition, which we embed inside the generated code.\n\n```go\nfunc GenerateTemplates(templates []string, t *template.Template, ops interface{}) (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```\nHelper function to pass a bunch of types to the template engine, and buffer its output into a string.\n\n```go\nfunc GenerateTypesForOperations(t *template.Template, ops []OperationDefinition) (string, error)\n```\nGenerates code for all types produced\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```\nReturns whether the given string is a go keyword\n\n```go\nfunc IsGoTypeReference(ref string) bool\n```\nThis function 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 The function 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 indentifier.\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```\nThis function 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 LowercaseFirstCharacter(str string) string\n```\nSame as above, except lower case\n\n```go\nfunc OrderedParamsFromUri(uri string) []string\n```\nReturns 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 PathToTypeName(path []string) string\n```\nThis 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```\nThis function 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 ReplacePathParamsWithStr(uri string) string\n```\nReplaces path parameters of the form {param} with %s\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 []string) map[string]string\n```\nSanitizeEnumNames fixes illegal chars in the enum names and removes duplicates\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.\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```\nConverts 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 SortedContentKeys(dict openapi3.Content) []string\n```\nThis returns Content dictionary keys in sorted order\n\n```go\nfunc SortedOperationsKeys(dict map[string]*openapi3.Operation) []string\n```\nThis function returns Operation dictionary keys in sorted order\n\n```go\nfunc SortedParameterKeys(dict map[string]*openapi3.ParameterRef) []string\n```\nThis returns sorted keys for a ParameterRef dict\n\n```go\nfunc SortedPathsKeys(dict openapi3.Paths) []string\n```\nThis function is the same as above, except it sorts the keys for a Paths dictionary.\n\n```go\nfunc SortedRequestBodyKeys(dict map[string]*openapi3.RequestBodyRef) []string\n```\n\n```go\nfunc SortedResponsesKeys(dict openapi3.Responses) []string\n```\nThis function returns Responses dictionary keys in sorted order\n\n```go\nfunc SortedSchemaKeys(dict map[string]*openapi3.SchemaRef) []string\n```\nThis function returns the keys of the given SchemaRef dictionary in sorted order, since Golang scrambles dictionary keys\n\n```go\nfunc SortedSecurityRequirementKeys(sr openapi3.SecurityRequirement) []string\n```\n\n```go\nfunc SortedStringKeys(dict map[string]string) []string\n```\nThis returns string map keys in sorted order\n\n```go\nfunc StringInArray(str string, array []string) bool\n```\nThis function checks whether the specified string is present in an array of strings\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 SwaggerUriToChiUri(uri string) string\n```\nThis function converts a swagger style path URI with parameters to a Chi compatible path URI. We need to replace all of 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```\nThis function converts a swagger style path URI with parameters to a Echo compatible path URI. We need to replace all of 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 SwaggerUriToGinUri(uri string) string\n```\nThis function converts a swagger style path URI with parameters to a Gin compatible path URI. We need to replace all of 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 ToCamelCase(str string) string\n```\nThis function 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 UppercaseFirstCharacter(str string) string\n```\nUppercase 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## Types\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}\n```\n\n```go\ntype EnumDefinition struct {\n\tSchema       Schema\n\tTypeName     string\n\tValueWrapper string\n}\n```\nEnumDefinition holds type information for enum\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 OperationDefinition struct {\n\tOperationId string // The operation_id description from Swagger, used to generate function names\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\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}\n```\nThis structure 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```\nReturns all parameters\n\n```go\nfunc (o *OperationDefinition) GetResponseTypeDefinitions() ([]ResponseTypeDefinition, error)\n```\nProduces 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) HasBody() bool\n```\nThis 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 or not we generate types for them.\n\n```go\nfunc (o *OperationDefinition) Params() []ParameterDefinition\n```\nReturns 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```\nThis returns the Operations summary as a multi line comment\n\n```go\ntype Options struct {\n\tGenerateChiServer  bool              // GenerateChiServer specifies whether to generate chi server boilerplate\n\tGenerateEchoServer bool              // GenerateEchoServer specifies whether to generate echo server boilerplate\n\tGenerateGinServer  bool              // GenerateGinServer specifies whether to generate echo server boilerplate\n\tGenerateClient     bool              // GenerateClient specifies whether to generate client boilerplate\n\tGenerateTypes      bool              // GenerateTypes specifies whether to generate type definitions\n\tEmbedSpec          bool              // Whether to embed the swagger spec in the generated code\n\tSkipFmt            bool              // Whether to skip go imports on the generated code\n\tSkipPrune          bool              // Whether to skip pruning unused components on the generated code\n\tAliasTypes         bool              // Whether to alias types if possible\n\tIncludeTags        []string          // Only include operations that have one of these tags. Ignored when empty.\n\tExcludeTags        []string          // Exclude operations that have one of these tags. Ignored when empty.\n\tUserTemplates      map[string]string // Override built-in templates from user-provided files\n\tImportMapping      map[string]string // ImportMapping specifies the golang package path for each external reference\n\tExcludeSchemas     []string          // Exclude from generation schemas with given names. Ignored when empty.\n}\n```\nOptions defines the optional code to generate.\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 DescribeParameters(params openapi3.Parameters, path []string) ([]ParameterDefinition, error)\n```\nThis function 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```\nThis function 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```\nReorders the given parameter definitions to match those in the path URI.\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) IndirectOptional() bool\n```\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```\nGenerate 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\"'\n\n```go\nfunc (pd *ParameterDefinition) Style() string\n```\n\n```go\nfunc (pd ParameterDefinition) TypeDef() string\n```\nThis function 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\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\tExtensionProps *openapi3.ExtensionProps\n}\n```\n\n```go\nfunc (p Property) GoFieldName() string\n```\n\n```go\nfunc (p Property) GoTypeDef() string\n```\n\n```go\ntype RefWrapper struct {\n\tRef       string\n\tHasValue  bool\n\tSourceRef interface{}\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```\nThis describes a request body\n\n```go\nfunc (r RequestBodyDefinition) CustomType() bool\n```\nReturns 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) 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```\nReturns the Go type definition for a request body\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```\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\t// The original OpenAPIv3 Schema.\n\tOAPISchema *openapi3.Schema\n}\n```\nThis describes a Schema, a type definition.\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```\nMerge all the fields in the schemas supplied into one giant schema.\n\n```go\nfunc (s Schema) GetAdditionalTypeDefs() []TypeDefinition\n```\n\n```go\nfunc (s Schema) IsRef() bool\n```\n\n```go\nfunc (s *Schema) MergeProperty(p Property) error\n```\n\n```go\nfunc (s Schema) TypeDecl() string\n```\n\n```go\ntype SchemaDescriptor struct {\n\tFields                   []FieldDescriptor\n\tHasAdditionalProperties  bool\n\tAdditionalPropertiesType string\n}\n```\nThis describes a Schema, a type definition.\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 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```\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 GenerateParamsTypes(op OperationDefinition) []TypeDefinition\n```\nThis 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```\nGenerates 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```\nGenerates 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.Responses) ([]TypeDefinition, error)\n```\nGenerates 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```\nGenerates type definitions for any custom types defined in the components/schemas section of the Swagger spec.\n\n```go\nfunc (t *TypeDefinition) CanAlias() bool\n```\n\n","path":"github.com/otto-eng/oapi-codegen/pkg/codegen","name":"codegen","synopsis":"","isRedistributable":true}
