Skip to content

Conversation

@qlaffont
Copy link

ref #52

@qlaffont
Copy link
Author

@kibertoad ?

@qlaffont
Copy link
Author

@kibertoad ? the repo is dead ?

@kibertoad
Copy link
Collaborator

sorry for the delay, will review today

src/index.ts Outdated
};
}

return ajv.compile(schema);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is correct. You are basically assuming that sometimes you are going to get an ajv schema, and hardcode falling back to using it if there are no zod-specific methods found. This is brittle, and too much hardcoding.

I don't mind a more universal approach that would allow users to pass their own fallback compilers for when zod one is not found, but it shouldn't be hardcoded

Copy link
Author

Choose a reason for hiding this comment

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

Agree with you, but I will keep the default if no fallback is precised. Because by default ajv is used on fastify.

src/index.ts Outdated
import type { z, ZodAny, ZodTypeAny } from 'zod';
import type { z, ZodAny, ZodError, ZodTypeAny } from 'zod';
import { zodToJsonSchema } from 'zod-to-json-schema';
import { fromZodError } from 'zod-validation-error';
Copy link
Collaborator

Choose a reason for hiding this comment

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

this change might be useful, but it seems to be unrelated to the issue with mercurius. Can you create a separate PR for that?

Copy link
Author

Choose a reason for hiding this comment

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

After this PR, I will do it

@qlaffont
Copy link
Author

@kibertoad ready for me

@qlaffont
Copy link
Author

qlaffont commented Jan 5, 2024

@kibertoad any update ?

2 similar comments
@qlaffont
Copy link
Author

qlaffont commented Jan 9, 2024

@kibertoad any update ?

@qlaffont
Copy link
Author

@kibertoad any update ?

@qlaffont
Copy link
Author

@kibertoad updated !

@qlaffont
Copy link
Author

@kibertoad any update ?

1 similar comment
@qlaffont
Copy link
Author

@kibertoad any update ?

@qlaffont qlaffont requested a review from kibertoad January 23, 2024 12:09
@qlaffont
Copy link
Author

@turkerdev @kibertoad 👋

5 similar comments
@qlaffont
Copy link
Author

@turkerdev @kibertoad 👋

@qlaffont
Copy link
Author

@turkerdev @kibertoad 👋

@qlaffont
Copy link
Author

@turkerdev @kibertoad 👋

@qlaffont
Copy link
Author

qlaffont commented Feb 1, 2024

@turkerdev @kibertoad 👋

@qlaffont
Copy link
Author

qlaffont commented Feb 2, 2024

@turkerdev @kibertoad 👋

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.

2 participants