Giter VIP home page Giter VIP logo

oapi-codegen's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oapi-codegen's Issues

Support wrapped http Clients using a HTTP client interface instead of the concrete http.Client

The standard library doesn't support features like Retry of error and different backoff strategies for the same. The recommended approach is to wrap the standard library HTTP client package with any custom handling logic. (See ianlancetaylor's reponse in golang/go#16047)
I propose adding an HTTPClient interface with the same method signatures as the standard library HTTP Client

    type Client
        func (c *Client) CloseIdleConnections()
        func (c *Client) Do(req *Request) (*Response, error)
        func (c *Client) Get(url string) (resp *Response, err error)
        func (c *Client) Head(url string) (resp *Response, err error)
        func (c *Client) Post(url, contentType string, body io.Reader) (resp *Response, err error)
        func (c *Client) PostForm(url string, data url.Values) (resp *Response, err error)

Added a PR for the same #86

Please let me know if this makes sense and can be supported. Would really benefit our team in adding retry mechanism to the client for all requests.

Ideas about new functions: chi support, request/response validation

I have some ideas to new functions and I am ready to code them.

  1. Add command line option to produce chi compatible server interface and handlers.
  2. Add support for full request validation.
    a) add middleware for chi router with params validation and secure validation;
    b) add secure validation to echo middleware.

For security validation there is needed for "AuthenticationFunc". I prefer to add it not as callback function, but as interface function.

  1. Add support for full response validation. There is two options.

a) validation may be added as on runtime basis as middleware: get generated response and validate it with openapi3filter. It is simple, but adds time to request processing;

b) static validation. We can generate boilerplate, so interface functions will be returns predefined genereated structs from boilerplate, these struct will be self-validated and produce from them json responses. It is more complicated, but will be more user-friendly to developer and gets better perfomance.

Please, say your opinion about this features.

feature request: GetSwaggerUi()

I'm currently using the following code generation:

// go:generate oapi-codegen --package=pkg --generate spec -o ./pkg/spec.gen.go ./openapi.yaml

I'm curious if you'd be open to adding the ability to embed the swagger-ui html file into the code generated by oapi-codegen.

What would be nice for my use case is if there was a GetSwaggerUI() alongside GetSwagger().

Support for type: object and {}

This project is great, glad I found it. Noticed this running against my own project:

The Java OpenAPI Tools code generator templates for go support type: object and Any Type ({} in OpenApi syntax) types, which I believe should just translate to map[string]interface{} and interface{} respectively, I think.

object just errors out in the current oapi-codegen, and using {} results in an empty anonymous struct type, which isn't quite right.

Generator error on string format

While working with a spec that had a parameter like below the generator would error.

uuid: 
  type: string
  format: uuid
  description: A unique identifier.
  example: 32b1b767-c1fe-4540-9bc3-b3a51fc4a0b7
$ oapi-codegen ./spec.yaml 
Error generating server stubs: error generating Go types for component schemas: error converting Schema Foo to Go type: error generating type for property 'uuid': invalid string format: uuid

The error is generated here https://github.com/deepmap/oapi-codegen/blob/3e1d4562edbe7d32393cc51b42a29d1b0c9fa270/pkg/codegen/schema.go#L244-L251

In a comment here it's referencing https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#dataTypes but it's not following the spec correctly

Also from
https://swagger.io/docs/specification/data-models/data-types/#format

However, to support documentation needs, the format property is an open string-valued property, and can have any value. Formats such as "email", "uuid", and so on, MAY be used even though undefined by this specification. Types that are not accompanied by a format property follow the type definition in the JSON Schema.

Where the default behavior is defined

Tools that do not recognize a specific format MAY default back to the type alone, as if the format is not specified.

So the default case should be

result = "string"

Issue with RequestBody types in generated code

Currently experiencing an issue where the {operation}JSONRequestBody types are not being used within the generated client methods.

e.g.

// spec.yaml

paths:
  /:
    post:
      operationId: create
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Data'

The generated API has the following types

// api.gen.go

type Data struct {
   ...
}

type createJSONBody []Data

type CreateJSONRequestBody createJSONBody

But, the client methods mistakenly use the createJSONBody type when they should use the CreateJSONRequestBody type.

The following is generated, and causes the client to error with cannot refer to unexported name api.createJSONBody

// api.gen.go

Create(ctx context.Context, body createJSONBody) (*http.Response, error)

...

func (c *Client) Create(ctx context.Context, body createJSONBody) (*createResponse, error) {
   ...
}

In my testing, manually changing this to CreateJSONRequestBody resolves the issue

// api.gen.go

type ClientInterface interface {
   Create(ctx context.Context, body CreateJSONRequestBody) (*http.Response, error)
}

...

func (c *Client) Create(ctx context.Context, body CreateJSONRequestBody) (*createResponse, error) {
   ...
}

This affects both the Client and ClientWithResponses methods.

Clean up double-slashes in URLs

Version: 1.3.0

If I have a document that defines absolute path URLs like /api/pets and then use the WithBaseURL option with my generated client, like so:

_, _ = lib.NewClient(context.TODO(), lib.WithBaseURL("http://localhost"))

The URLs that will be hit for my client requests will contain a double-slash, like http://localhost//api/pets. Not the end of the world, but some servers may fail to understand this request.

Generate default operationId if none provided in spec

Is it possible to create a default operationId using a combination of the Verb & Path if the operationId is not provided in the spec? More often than not the author of the original spec will use exactly that semantic to generate the operationId name. Rather than error out here just generate a default name?

The scenario I am faced is that a lot of the legacy specs, in my organization, in heavy use were authored without the need for operationId (since the codegen for most of the code only generated types). If this could be supported, that would be great IMO.

Missing Enum Values and validation code

I am trying to generate Golang code for following openapi 3 spec. I have doubts regarding Go code generation for enum related types.

openapi: "3.0.0"
info:
  version: 1.0.0
  title: Swagger Petstore
  description: A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification
  termsOfService: http://swagger.io/terms/
  contact:
    name: Swagger API Team
    email: [email protected]
    url: http://swagger.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: http://petstore.swagger.io/api
paths:
  /pets:
    post:
      summary: Post a PetType Information.
      description: Post a PetType Information.
      operationId: postPets
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/Cat'
                - $ref: '#/components/schemas/Dog'
      responses:
        '200':
          description: Updated
    get:
      summary: Returns a pet info by given petType.
      description: Get Pet Infrmation based on pet type.
      operationId: getPets
      parameters:
        - $ref: '#/components/parameters/PetType'
        - in: query
          name: petColor
          schema:
            type: string
      responses:
        '200':
          description: Get Pet Type 
          content:
            application/json: 
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Cat'
                  - $ref: '#/components/schemas/Dog'
components:
  schemas:
    Pet:
      type: object
      properties:
        color:
          $ref: '#/components/schemas/Color'
        name:
          type: string
          nullable: true
        owners:
          type: array
          nullable: false
          items:
            type: object
            properties:
              ownerName:
                type: string
              ownerAddress:
                type: string
                nullable: true
    Dog:
      allOf:
        - $ref: '#/components/schemas/Pet'
        - type: object
          required:
            - bark
          properties:
            bark:
              type: boolean
            breed:  
              type: string
              enum: [Dingo, Husky, Retriever, Shepherd]
              nullable: true
    Cat:
      allOf:
        - $ref: '#/components/schemas/Pet'
        - type: object
          properties:
            hunts:
              type: boolean
              nullable: true
            age:
              type: number
              format: float
              nullable: true
    Color:
      type: string
      nullable: true
      enum: 
        - black
        - white
        - red
        - green
        - blue
    PetTypeEnum:
      type: string
      enum:
        - cat
        - dog
  parameters:
    PetType:
      name: petType
      in: query
      required: true
      schema:
        $ref: '#/components/schemas/PetTypeEnum'

In the generate go code, enums defined in the YAML such as 'Color' and 'PetTypeEnum' are generated as String type which is expected.

type Color string 

But there are no 'const' generated for possible set of enum values defined in the input spec. I was exepcting following code to be generated with above code.

const (
        BLACK Color = "black"
        WHITE Color = "white"
        RED Color = "red"
        GREEN Color = "green"
        BLUE Color = "blue"
) 

Is this behaviour by design? I also do not see any validation function which will validate the input value against the possible enum values for a given field.

client response parsing needs cleanup

The client response parsing is now out of date with the code generation, since it doesn't use the templates which operate on internal models. It needs to be rewritten to generate all the code from the OperationDefinitions[] based input, like the server and client code.

Options for supporting anyOf or oneOf

Our organization is looking at using oapi-codegen and we have a need to support oneOf and are looking into a few potential ways to do so. I want to get feedback about which best fits into the oapi-codegen vision.

First of all, there would need to be discriminators used for any polymorphic objects (https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/).

With that in mind this is my proposal that I will implement if it looks good:

for the example spec (fragment):

paths: 
  /mything:
    put:
      summary: Put my thing
      operationId: putMyThing
      requestBody:
        description: Contents of thing
        required: true
        content:
          application-json:
            schema:
              discriminator:
                 propertyName: thingType
              oneOf:
                - $ref: "#/components/schemas/EasyThing"
                - $ref: "#/components/schemas/HardThing"

would generate an interface with

type ServerInterface interface {
	// Put my thing// (PUT /mything)
	PutMyThing(ctx echo.Context, discriminator string) error
}

Then the user could use the information gleaned from the discriminator to do something like:

m := make(map[string]interface{})
err := json.Unmarshal(ctx.Request().Body, &m)
switch m[discriminator] {
	case "easyThing":
		{
			doEasyThingStuff(ctx,m)
		}
	case "hardThing":
		{
			doHardThingStuff(ctx,m)
		}
}

uint64 support

Currently working on a crypto project and using this tech for a public API. Lot of crypto data is in uint64 and it would be great to have this supported via the schemas like so?

StakeUnits:
          type: integer
          format: uint64

Generator error: Client responses with body

Why are response models private?

I want to use API response models from other packages, but for some reason they are now generated privately (their names begin with a small letter):

type getFirstPetResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Pet
}

Why are they private?

Add generated code comments

As defined in this proposal.

All that's needed is to add comments to generated code matching ^// Code generated .* DO NOT EDIT\.$

chi-server generated API sets content type of text/plain

  1. Problem

When I generate the server code for chi, the response is always of type text/plain. Even setting

import "github.com/go-chi/render"

r := chi.NewRouter()
r.Use(render.SetContentType(render.ContentTypeJSON))

produces content-type text/pain.

  1. Expected
    Either response is of content-type application/json or respects set headers

Multiple url params - context error

When using nested URLs of entities like /pets/petID/dogs/dogID

The generator create the following code (middleware):

ctx := context.WithValue(r, "petID", 1)
ctx = context.WithValue(r, "dogID", 2)

Instead

ctx := context.WithValue(r, "petID", 1)
ctx = context.WithValue(ctx, "dogID", 2)

Because of what the variable petID is not available in handler

Case mismatch between spec and generated wrappers

Hi,

I found another minor problem when you have capitalized header key, such as X-API-KEY: FooBar, Echo will convert it in a Header map with X-Api-Key key while the generated still looking for X-API-KEY.

There is 2 possible solution, using headers[strings.ToLower(strings.Title(strings.ToLower("X-API-KEY")) or headers.Get("X-API-KEY") however the latter solution probably going to change to template a lot because now it's return the first value they found.

Thanks!

Better swagger spec validation

It's easy to make structural errors in swagger which still parse, but affect the output. On errors, we typically end up with some of the swagger spec parsed into the ExtensionProps members where they exist.

Validating these to ensure they only contain things of the form "x-.*" will catch many errors.

Type name hints via extensions

Schemas, Operations, support Swagger extensions. Rather than inferring Go type names from those properties, we can also allow specifying them. Adding support for an extension like x-go-typename on those would allow for more flexibility in naming the Swagger properties more clearly since they don't have to map to the same Go type.

Required and empty arrays are serialized with null values

Due to the default behaviour of the JSON serializer, an empty array gets serialized to value null.

type foo struct {
  bar []string
}

Resulting json

{
  "bar": null
}

See the following issue for indept discussion: golang/go#27589

Before d2cebc7, required arrays also got the omitempty tag. Although not perfect, that did the trick for us.

Would you consider adding the omitempty tag back to required arrays while the golang team is discussing options?

Embed runtime code into generated boilerplate

We currently have generic handlers for parameters in the runtime package. These use either reflection or the swagger spec to generically handle any parameter.

A much better, though more difficult approach would be to generate the specific code to marshal and unmarshal each parameter from a query. We know the exact style, format and content for each parameter at generation time, so we only need a subset of the generic code to handle each, and that could be embedded without any conditional type logic where it's used.

The thought of the template code to do this, though, makes me shake with fear.

Client implantation example

Hey be great to have a client implantation in the examples too. This would be a big help for dev's like me that are still somewhat new to golang. Thanks

golint compliance

The generated code and the code of the project itself causes a lot of warnings in the GoLand IDE and when checking with golint.

How about bringing code into line with golint?

I could help with that.

golint ./...
examples/petstore-expanded/chi/petstore_test.go:16:6: func DoJson should be DoJSON
examples/petstore-expanded/chi/api/petstore.go:12:6: exported type PetStore should have comment or be unexported
examples/petstore-expanded/chi/api/petstore.go:14:2: struct field NextId should be NextID
examples/petstore-expanded/chi/api/petstore.go:18:1: exported function NewPetStore should have comment or be unexported
examples/petstore-expanded/chi/api/petstore.go:36:1: comment on exported method PetStore.FindPets should be of the form "FindPets ..."
examples/petstore-expanded/chi/api/petstore.go:71:1: exported method PetStore.AddPet should have comment or be unexported
examples/petstore-expanded/chi/api/petstore.go:100:1: exported method PetStore.FindPetById should have comment or be unexported
examples/petstore-expanded/chi/api/petstore.go:100:20: method FindPetById should be FindPetByID
examples/petstore-expanded/chi/api/petstore.go:116:1: exported method PetStore.DeletePet should have comment or be unexported
examples/petstore-expanded/echo/petstore_test.go:80:2: var petId should be petID
examples/petstore-expanded/echo/petstore_test.go:110:2: var petId2 should be petID2
examples/petstore-expanded/echo/api/petstore.go:28:6: exported type PetStore should have comment or be unexported
examples/petstore-expanded/echo/api/petstore.go:30:2: struct field NextId should be NextID
examples/petstore-expanded/echo/api/petstore.go:34:1: exported function NewPetStore should have comment or be unexported
examples/petstore-expanded/echo/api/petstore.go:52:1: comment on exported method PetStore.FindPets should be of the form "FindPets ..."
examples/petstore-expanded/echo/api/petstore.go:83:1: exported method PetStore.AddPet should have comment or be unexported
examples/petstore-expanded/echo/api/petstore.go:122:1: exported method PetStore.FindPetById should have comment or be unexported
examples/petstore-expanded/echo/api/petstore.go:122:20: method FindPetById should be FindPetByID
examples/petstore-expanded/echo/api/petstore.go:122:50: method parameter petId should be petID
examples/petstore-expanded/echo/api/petstore.go:134:1: exported method PetStore.DeletePet should have comment or be unexported
examples/petstore-expanded/internal/doc.go:1:1: package comment should be of the form "Package internal ..."
internal/test/components/components_test.go:10:6: func assertJsonEqual should be assertJSONEqual
internal/test/issues/issue-52/doc.go:1:1: don't use an underscore in package name
internal/test/issues/issue-52/issue_test.go:1:1: don't use an underscore in package name
pkg/codegen/codegen.go:242:1: exported function GenerateTypeDefinitions should have comment or be unexported
pkg/codegen/codegen.go:285:1: comment on exported function GenerateTypesForSchemas should be of the form "GenerateTypesForSchemas ..."
pkg/codegen/codegen.go:309:1: comment on exported function GenerateTypesForParameters should be of the form "GenerateTypesForParameters ..."
pkg/codegen/codegen.go:341:1: comment on exported function GenerateTypesForResponses should be of the form "GenerateTypesForResponses ..."
pkg/codegen/codegen.go:380:1: comment on exported function GenerateTypesForRequestBodies should be of the form "GenerateTypesForRequestBodies ..."
pkg/codegen/codegen.go:418:1: comment on exported function GenerateTypes should be of the form "GenerateTypes ..."
pkg/codegen/codegen.go:441:1: comment on exported function GenerateImports should be of the form "GenerateImports ..."
pkg/codegen/codegen.go:465:1: comment on exported function GenerateAdditionalPropertyBoilerplate should be of the form "GenerateAdditionalPropertyBoilerplate ..."
pkg/codegen/inline.go:1:1: package comment should be of the form "Package codegen ..."
pkg/codegen/inline.go:27:1: comment on exported function GenerateInlinedSpec should be of the form "GenerateInlinedSpec ..."
pkg/codegen/operations.go:1:1: package comment should be of the form "Package codegen ..."
pkg/codegen/operations.go:28:6: exported type ParameterDefinition should have comment or be unexported
pkg/codegen/operations.go:36:1: comment on exported method ParameterDefinition.TypeDef should be of the form "TypeDef ..."
pkg/codegen/operations.go:44:1: comment on exported method ParameterDefinition.JsonTag should be of the form "JsonTag ..."
pkg/codegen/operations.go:47:32: method JsonTag should be JSONTag
pkg/codegen/operations.go:50:9: if block ends with a return statement, so drop this else and outdent its block
pkg/codegen/operations.go:55:1: exported method ParameterDefinition.IsJson should have comment or be unexported
pkg/codegen/operations.go:55:32: method IsJson should be IsJSON
pkg/codegen/operations.go:64:1: exported method ParameterDefinition.IsPassThrough should have comment or be unexported
pkg/codegen/operations.go:75:1: exported method ParameterDefinition.IsStyled should have comment or be unexported
pkg/codegen/operations.go:80:1: exported method ParameterDefinition.Style should have comment or be unexported
pkg/codegen/operations.go:96:1: exported method ParameterDefinition.Explode should have comment or be unexported
pkg/codegen/operations.go:111:1: exported method ParameterDefinition.GoVariableName should have comment or be unexported
pkg/codegen/operations.go:122:1: exported method ParameterDefinition.GoName should have comment or be unexported
pkg/codegen/operations.go:126:1: exported method ParameterDefinition.IndirectOptional should have comment or be unexported
pkg/codegen/operations.go:130:6: exported type ParameterDefinitions should have comment or be unexported
pkg/codegen/operations.go:132:1: exported method ParameterDefinitions.FindByName should have comment or be unexported
pkg/codegen/operations.go:141:1: comment on exported function DescribeParameters should be of the form "DescribeParameters ..."
pkg/codegen/operations.go:179:6: exported type SecurityDefinition should have comment or be unexported
pkg/codegen/operations.go:184:1: exported function DescribeSecurityDefinition should have comment or be unexported
pkg/codegen/operations.go:196:1: comment on exported type OperationDefinition should be of the form "OperationDefinition ..." (with optional leading article)
pkg/codegen/operations.go:198:2: struct field OperationId should be OperationID
pkg/codegen/operations.go:214:1: comment on exported method OperationDefinition.Params should be of the form "Params ..."
pkg/codegen/operations.go:222:1: comment on exported method OperationDefinition.AllParams should be of the form "AllParams ..."
pkg/codegen/operations.go:230:1: comment on exported method OperationDefinition.RequiresParamObject should be of the form "RequiresParamObject ..."
pkg/codegen/operations.go:237:1: comment on exported method OperationDefinition.HasBody should be of the form "HasBody ..."
pkg/codegen/operations.go:244:1: comment on exported method OperationDefinition.SummaryAsComment should be of the form "SummaryAsComment ..."
pkg/codegen/operations.go:257:1: comment on exported method OperationDefinition.GetResponseTypeDefinitions should be of the form "GetResponseTypeDefinitions ..."
pkg/codegen/operations.go:315:1: comment on exported type RequestBodyDefinition should be of the form "RequestBodyDefinition ..." (with optional leading article)
pkg/codegen/operations.go:335:1: comment on exported method RequestBodyDefinition.TypeDef should be of the form "TypeDef ..."
pkg/codegen/operations.go:340:1: comment on exported method RequestBodyDefinition.CustomType should be of the form "CustomType ..."
pkg/codegen/operations.go:347:1: comment on exported method RequestBodyDefinition.Suffix should be of the form "Suffix ..."
pkg/codegen/operations.go:358:1: comment on exported function FilterParameterDefinitionByType should be of the form "FilterParameterDefinitionByType ..."
pkg/codegen/operations.go:451:1: comment on exported function GenerateBodyDefinitions should be of the form "GenerateBodyDefinitions ..."
pkg/codegen/operations.go:515:1: exported function GenerateTypeDefsForOperation should have comment or be unexported
pkg/codegen/operations.go:533:1: comment on exported function GenerateParamsTypes should be of the form "GenerateParamsTypes ..."
pkg/codegen/operations.go:572:1: comment on exported function GenerateTypesForOperations should be of the form "GenerateTypesForOperations ..."
pkg/codegen/operations.go:665:1: comment on exported function GenerateServerInterface should be of the form "GenerateServerInterface ..."
pkg/codegen/operations.go:682:1: comment on exported function GenerateWrappers should be of the form "GenerateWrappers ..."
pkg/codegen/operations.go:701:1: comment on exported function GenerateRegistration should be of the form "GenerateRegistration ..."
pkg/codegen/operations.go:719:1: comment on exported function GenerateClient should be of the form "GenerateClient ..."
pkg/codegen/operations.go:737:1: comment on exported function GenerateClientWithResponses should be of the form "GenerateClientWithResponses ..."
pkg/codegen/schema.go:11:1: comment on exported type Schema should be of the form "Schema ..." (with optional leading article)
pkg/codegen/schema.go:24:1: exported method Schema.IsRef should have comment or be unexported
pkg/codegen/schema.go:28:1: exported method Schema.TypeDecl should have comment or be unexported
pkg/codegen/schema.go:35:1: exported method Schema.MergeProperty should have comment or be unexported
pkg/codegen/schema.go:46:1: exported method Schema.GetAdditionalTypeDefs should have comment or be unexported
pkg/codegen/schema.go:55:6: exported type Property should have comment or be unexported
pkg/codegen/schema.go:56:2: struct field JsonFieldName should be JSONFieldName
pkg/codegen/schema.go:61:1: exported method Property.GoFieldName should have comment or be unexported
pkg/codegen/schema.go:65:1: exported method Property.GoTypeDef should have comment or be unexported
pkg/codegen/schema.go:73:6: exported type TypeDefinition should have comment or be unexported
pkg/codegen/schema.go:75:2: struct field JsonName should be JSONName
pkg/codegen/schema.go:80:1: exported function PropertiesEqual should have comment or be unexported
pkg/codegen/schema.go:84:1: exported function GenerateGoSchema should have comment or be unexported
pkg/codegen/schema.go:200:9: if block ends with a return statement, so drop this else and outdent its block
pkg/codegen/schema.go:256:1: comment on exported type SchemaDescriptor should be of the form "SchemaDescriptor ..." (with optional leading article)
pkg/codegen/schema.go:263:6: exported type FieldDescriptor should have comment or be unexported
pkg/codegen/schema.go:267:2: struct field JsonName should be JSONName
pkg/codegen/schema.go:271:1: comment on exported function GenFieldsFromProperties should be of the form "GenFieldsFromProperties ..."
pkg/codegen/schema.go:287:1: exported function GenStructFromSchema should have comment or be unexported
pkg/codegen/schema.go:306:1: comment on exported function MergeSchemas should be of the form "MergeSchemas ..."
pkg/codegen/schema.go:359:1: comment on exported function GenStructFromAllOf should be of the form "GenStructFromAllOf ..."
pkg/codegen/template_helpers.go:1:1: package comment should be of the form "Package codegen ..."
pkg/codegen/template_helpers.go:222:1: comment on exported var TemplateFunctions should be of the form "TemplateFunctions ..."
pkg/codegen/utils.go:1:1: package comment should be of the form "Package codegen ..."
pkg/codegen/utils.go:42:1: comment on exported function UppercaseFirstCharacter should be of the form "UppercaseFirstCharacter ..."
pkg/codegen/utils.go:53:1: comment on exported function LowercaseFirstCharacter should be of the form "LowercaseFirstCharacter ..."
pkg/codegen/utils.go:63:1: comment on exported function ToCamelCase1 should be of the form "ToCamelCase1 ..."
pkg/codegen/utils.go:89:1: comment on exported function ToCamelCase should be of the form "ToCamelCase ..."
pkg/codegen/utils.go:104:1: comment on exported function SortedSchemaKeys should be of the form "SortedSchemaKeys ..."
pkg/codegen/utils.go:117:1: comment on exported function SortedPathsKeys should be of the form "SortedPathsKeys ..."
pkg/codegen/utils.go:130:1: comment on exported function SortedOperationsKeys should be of the form "SortedOperationsKeys ..."
pkg/codegen/utils.go:142:1: comment on exported function SortedResponsesKeys should be of the form "SortedResponsesKeys ..."
pkg/codegen/utils.go:154:1: comment on exported function SortedContentKeys should be of the form "SortedContentKeys ..."
pkg/codegen/utils.go:166:1: comment on exported function SortedStringKeys should be of the form "SortedStringKeys ..."
pkg/codegen/utils.go:178:1: comment on exported function SortedParameterKeys should be of the form "SortedParameterKeys ..."
pkg/codegen/utils.go:190:1: exported function SortedRequestBodyKeys should have comment or be unexported
pkg/codegen/utils.go:201:1: comment on exported function StringInArray should be of the form "StringInArray ..."
pkg/codegen/utils.go:212:1: comment on exported function RefPathToGoType should be of the form "RefPathToGoType ..."
pkg/codegen/utils.go:232:1: comment on exported function SwaggerUriToEchoUri should be of the form "SwaggerUriToEchoUri ..."
pkg/codegen/utils.go:243:6: func SwaggerUriToEchoUri should be SwaggerURIToEchoURI
pkg/codegen/utils.go:247:1: comment on exported function SwaggerUriToChiUri should be of the form "SwaggerUriToChiUri ..."
pkg/codegen/utils.go:258:6: func SwaggerUriToChiUri should be SwaggerURIToChiURI
pkg/codegen/utils.go:262:1: comment on exported function OrderedParamsFromUri should be of the form "OrderedParamsFromUri ..."
pkg/codegen/utils.go:264:6: func OrderedParamsFromUri should be OrderedParamsFromURI
pkg/codegen/utils.go:273:1: comment on exported function ReplacePathParamsWithStr should be of the form "ReplacePathParamsWithStr ..."
pkg/codegen/utils.go:278:1: comment on exported function SortParamsByPath should be of the form "SortParamsByPath ..."
pkg/codegen/utils.go:298:1: comment on exported function IsGoKeyword should be of the form "IsGoKeyword ..."
pkg/codegen/utils.go:336:1: comment on exported function SchemaNameToTypeName should be of the form "SchemaNameToTypeName ..."
pkg/codegen/utils.go:347:1: comment on exported function SchemaHasAdditionalProperties should be of the form "SchemaHasAdditionalProperties ..."
pkg/codegen/utils.go:363:1: comment on exported function PathToTypeName should be of the form "PathToTypeName ..."
pkg/middleware/oapi_validate.go:29:7: exported const EchoContextKey should have comment or be unexported
pkg/middleware/oapi_validate.go:30:7: exported const UserDataKey should have comment or be unexported
pkg/middleware/oapi_validate.go:36:1: comment on exported function OapiValidatorFromYamlFile should be of the form "OapiValidatorFromYamlFile ..."
pkg/middleware/oapi_validate.go:51:1: comment on exported function OapiRequestValidator should be of the form "OapiRequestValidator ..."
pkg/middleware/oapi_validate.go:64:1: comment on exported function OapiRequestValidatorWithOptions should be of the form "OapiRequestValidatorWithOptions ..."
pkg/middleware/oapi_validate.go:78:1: comment on exported function ValidateRequestFromContext should be of the form "ValidateRequestFromContext ..."
pkg/middleware/oapi_validate.go:107:20: should not use basic type string as key in context.WithValue
pkg/middleware/oapi_validate.go:112:20: should not use basic type string as key in context.WithValue
pkg/middleware/oapi_validate.go:136:1: comment on exported function GetEchoContext should be of the form "GetEchoContext ..."
pkg/middleware/oapi_validate.go:150:1: exported function GetUserData should have comment or be unexported
pkg/runtime/bindparam.go:1:1: package comment should be of the form "Package runtime ..."
pkg/runtime/bindparam.go:27:1: comment on exported function BindStyledParameter should be of the form "BindStyledParameter ..."
pkg/runtime/bindparam.go:105:10: if block ends with a return statement, so drop this else and outdent its block
pkg/runtime/bindparam.go:134:10: if block ends with a return statement, so drop this else and outdent its block
pkg/runtime/bindparam.go:154:10: if block ends with a return statement, so drop this else and outdent its block
pkg/runtime/bindparam.go:234:1: comment on exported function BindQueryParameter should be of the form "BindQueryParameter ..."
pkg/runtime/bindparam.go:310:13: if block ends with a return statement, so drop this else and outdent its block
pkg/runtime/bindparam.go:328:13: if block ends with a return statement, so drop this else and outdent its block
pkg/runtime/bindparam.go:347:10: if block ends with a return statement, so drop this else and outdent its block
pkg/runtime/bindparam.go:353:12: if block ends with a return statement, so drop this else and outdent its block
pkg/runtime/bindparam.go:374:12: if block ends with a return statement, so drop this else and outdent its block
pkg/runtime/bindstring.go:1:1: package comment should be of the form "Package runtime ..."
pkg/runtime/bindstring.go:24:1: comment on exported function BindStringToObject should be of the form "BindStringToObject ..."
pkg/runtime/router.go:1:1: package comment should be of the form "Package runtime ..."
pkg/runtime/router.go:20:1: comment on exported type EchoRouter should be of the form "EchoRouter ..." (with optional leading article)
pkg/runtime/styleparam.go:1:1: package comment should be of the form "Package runtime ..."
pkg/runtime/styleparam.go:25:1: comment on exported function StyleParam should be of the form "StyleParam ..."
pkg/testutil/request_helpers.go:1:1: package comment should be of the form "Package testutil ..."
pkg/testutil/request_helpers.go:39:1: exported function NewRequest should have comment or be unexported
pkg/testutil/request_helpers.go:45:1: comment on exported type RequestBuilder should be of the form "RequestBuilder ..." (with optional leading article)
pkg/testutil/request_helpers.go:55:1: comment on exported method RequestBuilder.WithMethod should be of the form "WithMethod ..."
pkg/testutil/request_helpers.go:62:1: exported method RequestBuilder.Get should have comment or be unexported
pkg/testutil/request_helpers.go:66:1: exported method RequestBuilder.Post should have comment or be unexported
pkg/testutil/request_helpers.go:70:1: exported method RequestBuilder.Put should have comment or be unexported
pkg/testutil/request_helpers.go:74:1: exported method RequestBuilder.Delete should have comment or be unexported
pkg/testutil/request_helpers.go:78:1: comment on exported method RequestBuilder.WithHeader should be of the form "WithHeader ..."
pkg/testutil/request_helpers.go:84:1: exported method RequestBuilder.WithContentType should have comment or be unexported
pkg/testutil/request_helpers.go:88:1: exported method RequestBuilder.WithJsonContentType should have comment or be unexported
pkg/testutil/request_helpers.go:88:26: method WithJsonContentType should be WithJSONContentType
pkg/testutil/request_helpers.go:92:1: exported method RequestBuilder.WithAccept should have comment or be unexported
pkg/testutil/request_helpers.go:96:1: exported method RequestBuilder.WithAcceptJson should have comment or be unexported
pkg/testutil/request_helpers.go:96:26: method WithAcceptJson should be WithAcceptJSON
pkg/testutil/request_helpers.go:102:1: exported method RequestBuilder.WithBody should have comment or be unexported
pkg/testutil/request_helpers.go:107:1: comment on exported method RequestBuilder.WithJsonBody should be of the form "WithJsonBody ..."
pkg/testutil/request_helpers.go:109:26: method WithJsonBody should be WithJSONBody
pkg/testutil/request_helpers.go:118:1: comment on exported method RequestBuilder.WithCookie should be of the form "WithCookie ..."
pkg/testutil/request_helpers.go:124:1: exported method RequestBuilder.WithCookieNameValue should have comment or be unexported
pkg/testutil/request_helpers.go:128:1: comment on exported method RequestBuilder.Go should be of the form "Go ..."
pkg/testutil/request_helpers.go:157:1: comment on exported type CompletedRequest should be of the form "CompletedRequest ..." (with optional leading article)
pkg/testutil/request_helpers.go:163:1: comment on exported method CompletedRequest.UnmarshalBodyToObject should be of the form "UnmarshalBodyToObject ..."
pkg/testutil/request_helpers.go:179:1: comment on exported method CompletedRequest.UnmarshalJsonToObject should be of the form "UnmarshalJsonToObject ..."
pkg/testutil/request_helpers.go:181:28: method UnmarshalJsonToObject should be UnmarshalJSONToObject
pkg/testutil/request_helpers.go:185:1: comment on exported method CompletedRequest.Code should be of the form "Code ..."

No error on empty operationId

It took me a while to figure out why the generated functions did not have a name and the output of the tool was something like the following:

error generating code: error formatting Go code: 201:1: expected '}', found '(' (and 10 more errors)

It turns out the operationId was not set. Adding a check might help the users prevent this mistake.

Remove hidden byte-order-marks (BOM) in generated code

Given some weird schemas with weird descriptions (i.e. a description, which gets autogenerated and filled via a CMS), one might end up with BOM (byte-order-marks) inside the []byte buffer.

The Go-Compiler is not happy with BOM. Therefore the generated Go-Code has to be cleaned up.

This could be done using awk:

 awk '{ gsub(/\xef\xbb\xbf/,""); print }' inputFile > outputFile

A better way, would be to add this cleanup right before one writes the generated Go-Code to disk.

Bug: Cannot distinguish between SecurityDefinitions override per path vs. inheriting global SecurityDefinitions

Bug

Type OperationDefinition assumes a slice SecurityDefinitions []SecurityDefinition as part of the operations, which are defined on a path.

See:
https://github.com/deepmap/oapi-codegen/blob/master/pkg/codegen/operations.go#L205

Explanation

This is problematic according to the Specification: https://swagger.io/docs/specification/authentication/

...
Step 2. Applying security
After you have defined the security schemes in the securitySchemes section, you can apply them to the whole API or individual operations by adding the security section on the root level or operation level, respectively. When used on the root level, security applies the specified security schemes globally to all API operations, unless overridden on the operation level. In the following example, the API calls can be authenticated using either an API key or OAuth 2. The ApiKeyAuth and OAuth2 names refer to the schemes previously defined in securitySchemes.

How to fix

Therfore to distinguish, whether a path wants to disable a globally defined securityScheme vs. inheriting the globally defined securityScheme, one has to use a pointer to a slice:

// use a pointer * to distinguish disable vs. inherit
`SecurityDefinitions *[]SecurityDefinition`

StyleParam on objects with pointer fields not supported

When passing an object to runtime.StyleParam that includes pointer field the following error is returned:
error formatting 'struct_field': unsupported type *string

This can be reproduced by adding an optional field in styleparam_test.go:

type TestObject struct {
	FirstName string  `json:"firstName"`
	LastName  *string `json:"lastName,omitempty"`
	Role      string  `json:"role"`
}
ln := "Johnson"
object := TestObject{
	FirstName: "Alex",
	LastName:  &ln,
	Role:      "admin",
}

I'm guessing the easiest fix would be to add a case in primitiveToString for pointers or maybe dereferencing it before going in to the switch.

Fallback to `interface{}` in case a type cannot be determined

In some weird OpenAPI specs, it is possible that you might have an array defined, but no items.
In the current implementation of oapi-codegen, this leads to a nullpointer-exception (NPE).

It would be better, if we could just fallback to an interface type. This way the generated Go-Code is fine and will compile, and it will be up to the user of the generated Go-Library to cast/map the interface{} to the appropiate Go-struct. It should not be a concern that the openapi-spec is crap, as long as we have interface{} available as a placeholder.

optional bson mapping when working with mongo

It would be amazing if we could have additional anotations to be generated in our interface for certain fields.
For example, when working with mongo we need to parse the field _id, in that case it would be nice to add the special bson:"_id" annotation for the id field in our interface.

Reserved golang keywords in spec cause errors

I have a type parameter in my spec as follows:

/animal/{type}:
    get:
      summary: Get an animal by type
      parameters:
        - name: type
          in: path
          required: true
          schema:
            type: string

Which resuls in the following server interface:

type ServerInterface interface {
  GetAnimalByType(ctx echo.Context, type string, params GetAnimalByTypeParams) error
}

But as you can see this results in a parameter named type which is a reseverd golang keyword.

Perhaps pre/post fixing all param names can prevent these errors.

Possible to split up ServerInterface

First of all thanks for this library ๐Ÿ˜„

After playing around with it for a while I experience a practical problem. The ServerInterface represents an interface for all serverHandlers. For quick prototyping this works well, however it becomes hard to use when organizing code based on entities.

For example, how would I use the registerHandlers correctly in this case:

type Project struct {
	r *ProjectRepo
}

func (p *Project) CreateProject(ctx Echo.Context) error {
        // non working repo insert
	r.Insert()

	return ctx.JSON(http.StatusOK, "")
}

type User struct {
	r *UserRepo
}

func (u *User) CreateUser(ctx Echo.Context) error {
        // non working repo insert
	r.Insert()
	return ctx.JSON(http.StatusOK, "")
}

e := echo.New()
// Now User and Project implement only a small part of the ServerInterface. And the
// RegisterHandlers would fail.
api.RegisterHandlers(e, ??)

How would we solve this issue? Could a solution be to register multiple (namespaces) handlers?

Add Go 1.13 reference in go.mod

Go 1.13 is out with language changes. It would be good to have it in go mod

See: https://golang.org/doc/go1.13#language

If your code uses modules and your go.mod files specifies a language version, be sure it is set to at least 1.13 to get access to these language changes. You can do this by editing the go.mod file directly, or you can run go mod edit -go=1.13.

Allow specifying a `skip-fmt` cli-param to debug generated code

Since there is a bunch of weird specs out there, the generated code sometimes fails.
I would like to debug, what is either wrong in the spec or how the generator can be made more robust.

The idea would be to add a skip-fmt option to the generator. This way the current behaviour is preserved, whilst one can allow skipping the fmt step.

Discrepancies between go get binary and local build

Hey, initially I wanted to create an unrelated issue and submimt a PR for this, but I stumpled upon a strange problem that's hard for me to figure out. I hope someone here could help.

I have created a simple openapi spec file:

openapi: 3.0.2
info:
  version: '0.0.1'
  title: example
  desscription: |
    additionalProperties problem example

components:
  schemas:
    Translations:
      type: object
      additionalProperties:
        type: string

When I am using the openapi binary from the go/bin path, sourced like this:
go get -u github.com/deepmap/oapi-codegen/cmd/oapi-codegen from outside of my $GOPATH, the file generated (~/go/bin/oapi-codegen -generate types -o go.get.binary.go -package types spec.yml) looks like this:

// Package types provides primitives to interact the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
package types

// Translations defines model for Translations.
type Translations map[string]interface{}

When I am using the locally built binary:

cd cmd/oapi-codegen/ && GO111MODULE=on go build && cd - 
./cmd/oapi-codegen/oapi-codegen -generate types -o local.binary.go -package types spec.yml

it looks like this:

// Package types provides primitives to interact the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
package types

import (
	"encoding/json"
	"fmt"
	"github.com/pkg/errors"
)

// Translations defines model for Translations.
type Translations struct {
	AdditionalProperties map[string]string `json:"-"`
}

plus some additional methods.
Could someone please explain to me what I am doing wrong with the locally built binary?

Adding support for external refs

Hey thanks for writing this library, I know it's still early days for this library but I was wondering if there were any plans to add support for external refs?

e.g.

`$ref: "../resource.yml/#components/schemas/Hello"`

I had a play around enabling SwaggerLoader.IsExternalRefsAllowed but ran into this

Only local document components are supported

Happy to contribute a patch but before doing so was wondering if there was any reason in particular for not supporting this feature.

Support "date" string format during marshaling

Version: 1.3.0

I have noticed that if I have a spec that includes a date field:

birthday:
  type: string
  format: date

My generated clients will have a *time.Time field created in the parameters struct. This works fine during unmarshaling, but a marshaled time.Time will not be in the date format 2017-07-21, but the datetime format 2017-07-21T00:00:00Z. This may throw off servers with strict input validation.

Flag for generating client or server only

I have an interest in just generating the HTTP client from swagger, although, I like the current behavior that generates both.

Is there any interest in a PR that would be something like --client-only or --server-only ?

Invalid character in function name

Hey all,

we have a special openapi definition which contains the following:

  /customer:
    post:
      summary: Create New Customer.
      operationId: customer-fn-create

This will fail with:

$ oapi-codegen -generate types spec.yaml > gen.go
error generating code: error formatting Go code: 158:14: expected type, found '-' (and 3 more errors)

As the generated code will be

// customer-fn-createJSONBody defines parameters for CustomerFnCreate.
type customer-fn-createJSONBody CustomerRequest

What do you think about auto resolving this issue? Just omit invalid characters in the generated names?

Regards,
Carsten

Stack overflow with recursive types

I'm creating an OpenAPI specification for the Google Firestore REST interface. This has some recursive types, which causes a stack overflow error using this tool.

Here's a sample YAML, based loosely on some of the Firestore data types:

openapi: 3.0.2
info:
  version: '0.0.1'
  title: example

paths:
  /example:
    get:
      operationId: exampleGet
      responses:
        '200':
          description: "OK"
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/Document'

components:
  schemas:
    Document:
      type: object
      properties:
        fields:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Value'

    Value:
      type: object
      properties:
        stringValue:
          type: string
        arrayValue:
          $ref: '#/components/schemas/ArrayValue'

    ArrayValue:
      type: array
      items:
        $ref: '#/components/schemas/Value'

Running this through the generator yields:

Error output ``` runtime: goroutine stack exceeds 1000000000-byte limit fatal error: stack overflow

runtime stack:
runtime.throw(0x14698c7, 0xe)
/usr/local/Cellar/go/1.11.5/libexec/src/runtime/panic.go:608 +0x72
runtime.newstack()
/usr/local/Cellar/go/1.11.5/libexec/src/runtime/stack.go:1008 +0x729
runtime.morestack()
/usr/local/Cellar/go/1.11.5/libexec/src/runtime/asm_amd64.s:429 +0x8f

goroutine 1 [running]:
strings.Count(0xc000020dc0, 0x1a, 0x1465e06, 0x1, 0x0)
/usr/local/Cellar/go/1.11.5/libexec/src/strings/strings.go:78 +0x141 fp=0xc020d8e350 sp=0xc020d8e348 pc=0x10d0e11
strings.genSplit(0xc000020dc0, 0x1a, 0x1465e06, 0x1, 0x0, 0xffffffffffffffff, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.11.5/libexec/src/strings/strings.go:248 +0x248 fp=0xc020d8e3b0 sp=0xc020d8e350 pc=0x10d18d8
strings.Split(0xc000020dc0, 0x1a, 0x1465e06, 0x1, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.11.5/libexec/src/strings/strings.go:303 +0x5b fp=0xc020d8e408 sp=0xc020d8e3b0 pc=0x10d1a8b
github.com/deepmap/oapi-codegen/pkg/codegen.RefPathToGoType(0xc000020dc0, 0x1a, 0x0, 0x0, 0x0, 0x0)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/utils.go:198 +0x4e fp=0xc020d8e450 sp=0xc020d8e408 pc=0x139075e
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b63, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:92 +0x18ae fp=0xc020d8ebb0 sp=0xc020d8e450 pc=0x138a15e
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b63, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d8f310 sp=0xc020d8ebb0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b62, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d8fa70 sp=0xc020d8f310 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b62, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d901d0 sp=0xc020d8fa70 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b61, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d90930 sp=0xc020d901d0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b61, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d91090 sp=0xc020d90930 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b60, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d917f0 sp=0xc020d91090 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b60, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d91f50 sp=0xc020d917f0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b5f, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d926b0 sp=0xc020d91f50 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b5f, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d92e10 sp=0xc020d926b0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b5e, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d93570 sp=0xc020d92e10 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b5e, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d93cd0 sp=0xc020d93570 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b5d, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d94430 sp=0xc020d93cd0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b5d, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d94b90 sp=0xc020d94430 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b5c, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d952f0 sp=0xc020d94b90 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b5c, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d95a50 sp=0xc020d952f0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b5b, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d961b0 sp=0xc020d95a50 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b5b, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d96910 sp=0xc020d961b0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b5a, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d97070 sp=0xc020d96910 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b5a, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d977d0 sp=0xc020d97070 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b59, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d97f30 sp=0xc020d977d0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b59, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d98690 sp=0xc020d97f30 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b58, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d98df0 sp=0xc020d98690 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b58, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d99550 sp=0xc020d98df0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b57, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d99cb0 sp=0xc020d99550 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b57, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d9a410 sp=0xc020d99cb0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b56, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d9ab70 sp=0xc020d9a410 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b56, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d9b2d0 sp=0xc020d9ab70 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b55, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d9ba30 sp=0xc020d9b2d0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b55, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d9c190 sp=0xc020d9ba30 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b54, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d9c8f0 sp=0xc020d9c190 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b54, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d9d050 sp=0xc020d9c8f0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b53, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d9d7b0 sp=0xc020d9d050 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b53, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d9df10 sp=0xc020d9d7b0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b52, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d9e670 sp=0xc020d9df10 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b52, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d9edd0 sp=0xc020d9e670 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b51, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020d9f530 sp=0xc020d9edd0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b51, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020d9fc90 sp=0xc020d9f530 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b50, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da03f0 sp=0xc020d9fc90 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b50, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da0b50 sp=0xc020da03f0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b4f, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da12b0 sp=0xc020da0b50 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b4f, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da1a10 sp=0xc020da12b0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b4e, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da2170 sp=0xc020da1a10 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b4e, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da28d0 sp=0xc020da2170 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b4d, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da3030 sp=0xc020da28d0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b4d, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da3790 sp=0xc020da3030 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b4c, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da3ef0 sp=0xc020da3790 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b4c, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da4650 sp=0xc020da3ef0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b4b, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da4db0 sp=0xc020da4650 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b4b, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da5510 sp=0xc020da4db0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b4a, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da5c70 sp=0xc020da5510 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b4a, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da63d0 sp=0xc020da5c70 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b49, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da6b30 sp=0xc020da63d0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b49, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da7290 sp=0xc020da6b30 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b48, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da79f0 sp=0xc020da7290 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b48, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da8150 sp=0xc020da79f0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b47, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da88b0 sp=0xc020da8150 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b47, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da9010 sp=0xc020da88b0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b46, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020da9770 sp=0xc020da9010 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b46, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020da9ed0 sp=0xc020da9770 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b45, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020daa630 sp=0xc020da9ed0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b45, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020daad90 sp=0xc020daa630 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b44, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020dab4f0 sp=0xc020daad90 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b44, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020dabc50 sp=0xc020dab4f0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b43, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020dac3b0 sp=0xc020dabc50 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b43, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020dacb10 sp=0xc020dac3b0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b42, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020dad270 sp=0xc020dacb10 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b42, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020dad9d0 sp=0xc020dad270 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b41, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020dae130 sp=0xc020dad9d0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b41, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020dae890 sp=0xc020dae130 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b40, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020daeff0 sp=0xc020dae890 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b40, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020daf750 sp=0xc020daeff0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b3f, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020dafeb0 sp=0xc020daf750 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b3f, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db0610 sp=0xc020dafeb0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b3e, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db0d70 sp=0xc020db0610 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b3e, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db14d0 sp=0xc020db0d70 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b3d, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db1c30 sp=0xc020db14d0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b3d, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db2390 sp=0xc020db1c30 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b3c, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db2af0 sp=0xc020db2390 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b3c, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db3250 sp=0xc020db2af0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b3b, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db39b0 sp=0xc020db3250 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b3b, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db4110 sp=0xc020db39b0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b3a, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db4870 sp=0xc020db4110 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b3a, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db4fd0 sp=0xc020db4870 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b39, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db5730 sp=0xc020db4fd0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b39, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db5e90 sp=0xc020db5730 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b38, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db65f0 sp=0xc020db5e90 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b38, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db6d50 sp=0xc020db65f0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b37, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db74b0 sp=0xc020db6d50 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b37, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db7c10 sp=0xc020db74b0 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b36, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db8370 sp=0xc020db7c10 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b36, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db8ad0 sp=0xc020db8370 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b35, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020db9230 sp=0xc020db8ad0 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b35, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020db9990 sp=0xc020db9230 pc=0x1389840
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00000de80, 0xc04157a000, 0x22b34, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:149 +0x274 fp=0xc020dba0f0 sp=0xc020db9990 pc=0x1388b24
github.com/deepmap/oapi-codegen/pkg/codegen.GenerateGoSchema(0xc00015c220, 0xc04157a000, 0x22b34, 0x24400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/duncan/go/src/github.com/deepmap/oapi-codegen/pkg/codegen/schema.go:203 +0xf90 fp=0xc020dba850 sp=0xc020dba0f0 pc=0x1389840
...additional frames elided...

</details>

Add documentation for request validation

First of all, thank you all for the work you are putting into this project.

I am currently evaluating this for a project of mine. Reading through #54 I found out that validation can be achieved using kin-openapi's openapi3filter.
I think it would be useful to document this in the main README, maybe even with an example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.