X Tutup
Skip to content

Reserved golang keywords in spec cause errors #30

@stevenvegt

Description

@stevenvegt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup