Skip to content

False positive for Definition missing path parameters #47

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

Closed
jcoyne opened this issue Dec 18, 2019 · 3 comments
Closed

False positive for Definition missing path parameters #47

jcoyne opened this issue Dec 18, 2019 · 3 comments

Comments

@jcoyne
Copy link

jcoyne commented Dec 18, 2019

When I run my spec through the linter I get the following error:

One or more errors exist in the OpenApi definition
  at: paths
    at: /queues/{path}/{file}
      Path parameter definitions inconsistent
        at: get
          Definition missing path parameters: path, file

I'm having trouble finding where this is required by the spec. Is it possible this shouldn't be alerting?

@Gi60s
Copy link
Owner

Gi60s commented Dec 18, 2019

Help me to understand the question a bit better. Have you defined a path /queues/{path}/{file} that does not define parameters, specifically the path parameters?

I also could not find this clearly written in the spec, besides that in the parameters object all path parameters are supposed to be set to required: true:

https://swagger.io/specification/#parameterObject

If the parameter location is "path", this property is REQUIRED and its value MUST be true. Otherwise, the property MAY be included and its default value is false.

Also, trying to define a path /queues/{path}/{file} in the online swagger editor without defining the parameters in the parameter array results in these errors:

  • Declared path parameter "path" needs to be defined as a path parameter at either the path or operation level

  • Declared path parameter "file" needs to be defined as a path parameter at either the path or operation level

Am I misunderstanding the question? You're OpenAPI document might help, or a portion of it, to understand better the question.

@jcoyne
Copy link
Author

jcoyne commented Dec 19, 2019

Okay, I've asked for clarification on the spec OAI/OpenAPI-Specification#2079 It does seem a strong indicator of correctness that https://editor.swagger.io is following this convention too.

@Gi60s
Copy link
Owner

Gi60s commented Dec 20, 2019

I'll close this issue for now, but I'm happy to reopen it if we find there is a need for change. Thank you.

@Gi60s Gi60s closed this as completed Dec 20, 2019
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

2 participants