Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jcoyne opened this issue Dec 19, 2019 · 2 comments
Closed

Comments

@jcoyne
Copy link

jcoyne commented Dec 19, 2019

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.

@MikeRalphson
Copy link
Member

Related discussions in #1830 and PR #1831

@webron
Copy link
Member

webron commented Feb 12, 2020

As #1831 is merged, it should now be clearer that indeed it's required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants