how to have multiple response type in openapi? #479
Unanswered
HananoshikaYomaru
asked this question in
Q&A
Replies: 2 comments
-
This feature is planed, I will be working on this soon |
Beta Was this translation helpful? Give feedback.
0 replies
-
For error responses, i'm doing it like so: export const UNPROCESSABLE_CONTENT = oo.spec(
{},
current => ({
...current,
responses: {
...current.responses,
422: {
...(current.responses && current.responses['422']),
description: 'Unprocessable Content. Data sent to the server couldnt be processed.',
},
},
}),
);
export const NOT_FOUND = oo.spec(
{},
current => ({
...current,
responses: {
...current.responses,
404: {
...(current.responses && current.responses['404']),
description: 'Not Found. The requested resource was not found.',
},
},
}),
); Then you can just add them to your errors as normal oc
.route(...)
.errors({
NOT_FOUND,
UNPROCESSABLE_CONTENT
})
.input(...)
.output(...), |
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
Uh oh!
There was an error while loading. Please reload this page.
-
how to have multiple response type in openapi?
This will show only 200 response but it can also be other response? I tried using
oo.spec
but it seems like it override rather than merging.Beta Was this translation helpful? Give feedback.
All reactions