Skip to content
New issue

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 it possible to bypass schema validation? #3

Open
ianengelbrecht opened this issue Jul 24, 2023 · 1 comment
Open

Is it possible to bypass schema validation? #3

ianengelbrecht opened this issue Jul 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ianengelbrecht
Copy link

I only want a simple store without schema validation. Can I pass null to the second parameter, so something like that? I'm trying to avoid having to use another framework (zod in this case) in my app.

@efstajas
Copy link
Owner

Hey! Currently, unfortunately the answer is no(ish). You can theoretically pass z.any() as the schema, which will cause Zod to accept any schema, and set the writable's type to be any. However, you'd still need Zod to do this, but only to get the z.any function.

Since I personally think that naively parsing data from a client environment you can't control is pretty risky, I'm not sure if I'd rather add the ability to disable schema parsing entirely or only add support for parsers other than Zod for projects that already use another parsing library.

I'm currently leaning towards supporting different parsers and no parser at all in a new version, but it'd be a breaking v0.2 since I'd want the schema argument to be optional if it can be null. Unfortunately can't make any promises as to when this will be possible right now.

Either way, keeping this issue open to track the request 👍

@efstajas efstajas added the enhancement New feature or request label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants