-
Notifications
You must be signed in to change notification settings - Fork 331
Custom Formats not evaluated #832
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
Comments
I'm fairly certain my issue was that I was assuming passing the schema URI would load the right "base" validator and that I was adding additional formats. Looking more closely at the code, that doesn't seem to be the case, but doing:
Doesn't seem to help. |
@zsblevins Take a look at this unit-test and see if this helps. I cannot test your code since I don't have IPAddress and IPAddressString. |
I don't really see anything I'm doing differently than that test case aside from using new names instead of overwriting existing. Here's another example that fails that doesn't use an IP addressing library:
|
I believe I see the issue: Later, an attempt to read from this hash map is made here with the normalized uri of |
Just wanted to check in on when a release will be created containing this change. While I was able to work around it in my tests, we have a ton of legacy JSON Schemas that we're using that have the non-normalized schema URL format and that we can't safely change without concern that we'd break the existing tooling that interacts with them. |
I have released 1.0.86. https://github.com/networknt/json-schema-validator/releases/tag/1.0.86 |
I've created several custom formats but they don't seem to be evaluating:
Sample custom format:
I create my JSONSchema as follows:
Where
formats
includesnew IpHostPrefixFormat()
in the list.If I then test the following schema against the json, it passes validation when it should fail.
I wrote test cases for the
matches
method on every custom formatter and confirmed they work as expected, it just seems like the schema isn't using them. Am I constructing the Meta schema improperly?Note that standard validators (e.g. string, number, etc) are all working fine in my tests, it's only the custom formats that do not work.
The text was updated successfully, but these errors were encountered: