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

Strict for deep objects #315

Open
zaksmok opened this issue Jan 3, 2023 · 1 comment
Open

Strict for deep objects #315

zaksmok opened this issue Jan 3, 2023 · 1 comment

Comments

@zaksmok
Copy link

zaksmok commented Jan 3, 2023

Is it possible to set strict mode (yes/remove) to the deep objects somehow?

const schema = {
  $$strict: true,
  set: {
    type: 'object',
    props: {
      a: { type: 'number', min: 0, max: 1, optional: true },
      b: { type: 'number', min: 0, max: 1, optional: true },
    },
  },
  set2: {
    type: 'object',
    props: {
      a: { type: 'number', min: 0, max: 1, optional: true },
      b: { type: 'number', min: 0, max: 1, optional: true },
    },
  },
};

const payload = {
  set: {
    c: false,
    d: 'xxx',
  }
}
@fernandodevelon
Copy link

fernandodevelon commented Jul 10, 2023

look at object documentation,
you have the strict property
https://github.com/icebob/fastest-validator#object

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

No branches or pull requests

2 participants