We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there a way to use the oneOf attribute on the response specification?
Like this:
export class PreviewLink extends OpenAPIRoute { static schema: OpenAPIRouteSchema = { tags: ["Link Preview"], summary: "Previews the contents of a given link", requestBody: { description: "Preview request options", required: true, content: { "application/json": { schema: PreviewLinkRequestData, }, "application/x-www-form-urlencoded": { schema: PreviewLinkRequestData, }, "multipart/form-data": { schema: PreviewLinkRequestData, }, }, }, responses: { "200": { description: "Returns the link preview", schema: { oneOf: [ ResponseDocLink, ResponseXUserLink, ResponseXPostLink, ResponseYoutubeChannelLink, ResponseYoutubeVideoLink, ResponseHtmlLink, ResponseImageLink, ResponseVideoLink, ResponseAudioLink, ResponseInstagramUserLink, ResponseInstagramPostLink, ], }, }, }, };
The text was updated successfully, but these errors were encountered:
@lifenautjoe I was just browsing this repo for the first time and stumbled across your question. Have you tested this? do you know that anyOf, oneOf or allOf do not work for a fact? It's mentioned briefly here in the readme talking about zod schemas; https://github.com/cloudflare/itty-router-openapi/blob/89255c154a0421f7efb68b7d83d97b1964b8bc6a/docs/pages/types.md?plain=1#L221-L225
anyOf
oneOf
allOf
zod
Sorry, something went wrong.
No branches or pull requests
Is there a way to use the oneOf attribute on the response specification?
Like this:
The text was updated successfully, but these errors were encountered: