Path parameters outside operation blocks aren't supported
Closed this issue · 2 comments
Committee doesn't seem to support the following OpenAPI 3.0 form of path parameter specifications:
path:
/this/{xyz}:
parameters:
- name: "xyz"
#...
get:
operationId: get-this
# ...
post:
operationId: post-this
# ...
(Note that parameters
is specified at the same level as get
, post
etc. Note: there may be other parameters
specified inside each operation as well.)
Committee does allow this:
path:
/this/{xyz}:
get:
operationId: get-this
# ...
parameters:
- name: "xyz"
#...
post:
operationId: post-this
# ...
parameters:
- name: "xyz"
#...
(With path parameters
nested inside each operation only.)
Current behavior
Committee seems match the path (even in strict mode) but doesn't validate the API specification further. There's no error or other feedback, even if the specification absolutely contains errors that committee should detect.
This means we get no feedback about this situation, let alone the cause. Modifying the OpenAPI specification from the first form to the second also isn't time well-spent.
Expected behavior
Both forms should be supported. A well-known OpenAPI design tool (Stoplight Studio) always chooses the first form, so it's desirable that Committee support it as well.
Support probably entails just merging the parameters
at the "path" level into the parameters
of each (get
/post
/...) "operation" defined for that path.
Thank you for the report! I was able to reproduce this bug.
This bug is openapi_parser's bug so I created issue :)
We can fix this bug using openapi_paraser >= 0.14.1