-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
what method to use when link objects use operationRef #1688
Comments
The links:
UserRepositories:
# returns array of '#/components/schemas/repository'
operationRef: '#/paths/~12.0~1repositories~1{username}/get'
parameters:
username: $response.body#/username here the method is |
@dret does this answer your query? |
not quite, but thanks for looking into this. i am still wondering: clients are expected to parse the URI and extract the last component of the path in the fragment identifier? if that's the logic they're supposed to use, that should be documented. if there's a different way (this way seems sort of brittle and not easy to implement, in particular given that the URI syntax has no concept of paths in fragments identifiers, and thus URI parsers wouldn't help with implementing this), that should be documented instead. |
It's not the URI format which dictates the way fragments are interpreted. As I'm lead to understand, it is the mediatype. Here that is (effectively) It is the tooling interpreting the OAS document which needs to parse and follow the |
On 2018-10-27 12:40, Mike Ralphson wrote:
It's not the URI format which dictates the way fragments are
interpreted. As I'm lead to understand, it is the mediatype. Here that
is (effectively) |application/json| so JSON reference rules are used.
very true. but then you have to parse the fragment identifiers
themselves. btw, there are no fragment identifiers defined for JSON, so
what you're referring to here is the way in which OpenAPI defines and
uses them.
It is the tooling interpreting the OAS document which needs to parse and
follow the |operationRef| (not a runtime client interpreting a
response), so it is relatively simple for that tool to recognise it has
reached an |operation| object where (in this case) |get| is the last
component of the ref - and thus the method to use.
ok. maybe i was misled by my hope that OpenAPI would not be as closed as
it seems to be: you can only link to other OpenAPI descriptions, and not
to other URIs out there that may not be described by OpenAPI.
anyway, maybe i was misreading this because i hoped to find something
that resembles actual hyperlinking.
i suggested a small tweak to make the text a bit easier to parse, but i
think now i finally do understand how the mechanism works. thanks!
|
Thanks for the PR! |
Sounds like there was a PR and this was resolved - closing. |
i may just not be able to find it, but it seems to me that when link objects use
operationRef
(instead ofoperationId
), it is not specified which method to use for the request? i am looking at the examples ar https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#operationref-examples and wonder how an actual request would look like. i don't know how to figure out which method to use.The text was updated successfully, but these errors were encountered: