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
For type definition:
const DBData = z.object({ nested: z.object({ a: z.string(), b: z.string(), }), })
The following validator is generated:
function __validator_0__(data) { return (__validator_meta__(data) && ( __validator_keys__(data, ['nested']) && (data.nested.a is string && data.nested.b is string) )); }
However the validator doesn't check if there's extra keys in data.nested, so the following data would be allowed:
data.nested
{ nested: { a: '', b: '', other: 'hey!', }, }
Fireschema should generate something like:
function __validator_0__(data) { return (__validator_meta__(data) && ( __validator_keys__(data, ['nested']) && (data.nested.a is string && data.nested.b is string && data.nested.keys().hasOnly(['a', 'b'])) )); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For type definition:
The following validator is generated:
However the validator doesn't check if there's extra keys in
data.nested
, so the following data would be allowed:Fireschema should generate something like:
The text was updated successfully, but these errors were encountered: