Matching responses #44
Unanswered
rafalkrupinski
asked this question in
Q&A
Replies: 1 comment
-
This is a great question and I think in my head I was imagining "most precise match wins". I would be interesting to see where that rule gets difficult to implement. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The example response in the project's Readme has a new property called apiResponses, which, I presume, contains api-global responses - that apply to all the operations.
Suppose the scenario where pathResponses has a responses with
status: 4XX
and apiResponses hasstatus: 404
(alternatively40X
), both have the same content-type and the actual response has status 404.Does the response in pathResponses takes precedence as being defined in more specific context (operation vs api-global) or is it apiResponse since it's more specific status code.
My answer would be to look at apiResponses only when pathResponses doesn't have any matching responses, but I guess the consistency with the rest of the specification should also be considered.
Similar question applies to status vs content-type:
matched against:
OAS 3.X had only one response map for each operation and put content-type under status code, which made the precedence clear.
Beta Was this translation helpful? Give feedback.
All reactions