Skip to content

Should Path Template replaceable sections be required in parameters section? #2079

Closed
@jcoyne

Description

@jcoyne

The spec does not say that replaceable sections in a path template must be in the parameters section (or at least I'm not seeing it). Some clarifying text would be helpful.

When I use this document:

openapi: 3.0.0
info:
  title: Sample
  version: v1
paths:
  "/pets/{id}":
    get:
      responses:
        200:
          description: "OK"

and put it in http://editor.swagger.io/

I get this error:

Semantic error at paths./pets/{id}
Declared path parameter "id" needs to be defined as a path parameter at either the path or operation level
Jump to line 6

It seems either the spec is missing this requirement or the editor is imposing requirements that are not in spec.

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