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

Ajv is in strictmode #169

Open
tganzhorn opened this issue Oct 7, 2022 · 8 comments
Open

Ajv is in strictmode #169

tganzhorn opened this issue Oct 7, 2022 · 8 comments

Comments

@tganzhorn
Copy link

Ajv is in strictmode which makes the usage of validation keywords impossible.

Solution:
Disable strictmode for ajv.

@sindresorhus
Copy link
Owner

How does it make it impossible? Can you please elaborate a little bit more?

@tganzhorn
Copy link
Author

tganzhorn commented Oct 7, 2022

Ok I have to rephrase that. We can’t use user defined keywords. Like for example when I want to use a „visible“ (or any other user defined keyword) keyword on an object for later usage. Ajv throws an error on unknown keywords, and since we don’t have a way to add custom keywords it’s impossible to use that feature. Ajv enabled strict mode in some release I don’t quite remember but there’s a possibility you didn’t catch that change. Greetings from Germany and sorry for my mediocre English 😅

@sindresorhus
Copy link
Owner

@sindresorhus
Copy link
Owner

Wouldn't it be better to support adding custom keywords? Strict mode brings a lot of good. I don't think I want to disable it.

@tganzhorn
Copy link
Author

I guess that’s also a possibility, or let the user decide if he wants to disable strict mode completely or wants to add custom keywords.

@tganzhorn
Copy link
Author

And yeah strict mode brings a lot of good stuff but sometimes you gotta use them custom keywords 😁

@sindresorhus
Copy link
Owner

I think we could add a schemaOptions top-level option that accepts a additionalKeywords option.

@tganzhorn
Copy link
Author

You can assign this issue to me if you want to. I‘m sure I can add this feature to the codebase.

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

No branches or pull requests

2 participants