Skip to content

Missing path parameters go unnoticed #52

@fenollp

Description

@fenollp

Using https://editor.swagger.io/ I just caught a few errors that so far had gone unnoticed. I had a few routes with path parameters (e.g. get("/dota2/abilities/:dota2_ability_id", Dota2.AbilityController, :show)) but I forgot to declare :dota2_ability_id in the parameters list. Here it is, commented out:

  @spec open_api_operation(atom()) :: Op.t()
  # /dota2/abilities/:dota2_ability_id
  def open_api_operation(:show),
    do: %Op{
    # parameters: [OpenAPI.param(:dota2_ability_id)],
      responses: OpenAPI.resp_Dota2Ability()
    }

Could we add some check that makes the ....OpenAPI.spec() call fail if path parameters are missing?
I'm not sure what could be done for missing parameters of other kinds.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions