-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
option compile from addKeyword doesn't change on a remove and then add again #2411
Comments
Can you please produce a minimal example using this runkit template? It should be possible to reproduce the issue without |
Hello, |
I have looked into this and I have been able to replicate with an even simpler example. |
I got to the bottom of the issue @rgpro007. Here you can see my minimal example that reproduces the issue and then fixes it. The reason you are hitting this issue is that for performance reasons, AJV caches a lot of things. In this case you have a cached schema which has already been compiled. When you try to compile the same schema again, it skips certain steps to save time. The simple solution is to use |
After reviewing the docs I am confident this is how it is intended to be and the docs are clear enough on how you should only compile schemas once. So I will close this one and leave you with two links: |
Thank for you help. |
Here my issue (if it's one):
I setup a keyword with addKeyword and the compile option. I have some external variables used inside. At the first iteration everything is ok, but at the second one we see the variables doesn't change. Is it a normal behavior or an issue ?
What version of Ajv are you using?
version 8.12.0
Your code
Output obtained
What results did you expect?
the ajv.removeKeyword really remove the keyword and allow us the define it again.
Are you going to resolve the issue?
The text was updated successfully, but these errors were encountered: