-
Notifications
You must be signed in to change notification settings - Fork 3
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
Handle references to path-items (3.1.1, 3.2) #71
Comments
partial duplicate of #53 |
relevant changes to the spec and spec schema:
|
When traversing the document:
When evaluating at runtime:
Maybe for 3.1.x we can just opt to not support $refs inside path-items at all (which is now allowed via OAI/OpenAPI-Specification#3355) - to avoid having to implement all the above logic. In 3.2.0 the logic is changing (OAI/OpenAPI-Specification#2657) -- I think it should change to a path-item entry either being a normal definition, OR just a $ref (but not a combination of both), so we can treat ref resolution here in the normal way when in |
For 3.1.1, we can check for and disallow $refs, even in 3.1.0, because the published schema allows for path-item-or-reference (albeit in a convoluted way that allows stacking, which is the bit we don't want to support). For 3.2 we need to be serious about proper support, which also means we can't assume that path_item_path is under We also aren't doing as many cross-checks between values in the options hash as we should be. |
If paths:
/hello:
$ref: '#/paths/~1goodbye'
/goodbye:
get:
operationId: greeting If provided a request like If the path-item lives in /components, the unjsonp operation will fail entirely. This also now means it would be no longer possible to call find_path with just operation_path and path_captures -- we cannot infer the path_template from operation_path as the operation might be shared between multiple paths. However, |
splitting up for validate_response:
for validate_request:
|
Note that the semantics for $ref in path-item will be changing from what we initially thought -- https://github.com/OAI/OpenAPI-Specification/pull/3860/files The published schema for 3.1.0 will be changing to allow sibling $ref, with all the complications of multiple overlapping definitions; we may want to simply not support this, or disallow adding multiple operation and parameter definitions at each sub-level of $ref (and only respect the definitions in the final object). |
see also OAI/OpenAPI-Specification#3734 - this won't be changing in 3.1.1 nor 3.2. |
Because
/paths
might contain references to path-items (this is allowed by the spec but not by the 3.1.0 schema, but may be fixed in 3.1.1), meaning the path-item object itself is not always at/paths/$path_template
and the operation may not be at/paths/$path_template/$method
:$options
hash populated byfind_path
, for use by callersfind_path
should to include in the$options
hash the full uri of the path-item found (this could be useful for logging, as well as returning in a response along with the validation result)The text was updated successfully, but these errors were encountered: