Skip to content

fix: allow openapi schema#128

Open
turkerdev wants to merge 1 commit intomainfrom
allow-raw-schema
Open

fix: allow openapi schema#128
turkerdev wants to merge 1 commit intomainfrom
allow-raw-schema

Conversation

@turkerdev
Copy link
Copy Markdown
Owner

fixes #127

We can allow users to use raw openapi schema by skipping schema transformation if the schema is not instance of zod.

Comment thread src/core.ts
const responseSchema = response[prop]

const transformedResponse = convertZodToJsonSchema(schema)
if (responseSchema instanceof ZodSchema === false) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use typeguard instead to make it work across realms?

@kibertoad
Copy link
Copy Markdown
Collaborator

@turkerdev maybe this should be mentioned in the docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to add response headers with cookies in Swagger using fastify-type-provider-zod?

2 participants