json-schema-validator icon indicating copy to clipboard operation
json-schema-validator copied to clipboard

Validator for version 7 produces "Unkwown keyword" warning for examples and additionalItems

Open oscarmon7 opened this issue 5 years ago • 7 comments

I got the following two warnings when validating a json under a version 7 schema:

2020-09-23 10:20:50.109 WARN 22732 --- [ main] com.networknt.schema.JsonMetaSchema : Unknown keyword examples - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword 2020-09-23 10:20:50.109 WARN 22732 --- [ main] com.networknt.schema.JsonMetaSchema : Unknown keyword additionalItems - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword

oscarmon7 avatar Sep 23 '20 09:09 oscarmon7

@oscarmon7 Thanks a lot for reporting this. Some keywords are not implemented yet so the reports are reasonable. Once we complete all keywords, the warnings will dispear.

stevehu avatar Sep 23 '20 13:09 stevehu

Coincidentally - just hit a similar seeming issue with "then". Guessing it's probably the same cause?

ascertrobw avatar Sep 23 '20 13:09 ascertrobw

"then" is a little different as we only have the keyword "if" defined. However, the entire if-then-else works without any issue.

stevehu avatar Sep 23 '20 15:09 stevehu

Odd - I've been seeing an Unknown keyword on "then" but possibly it's because I'm using the Maven Central release version rather than the latest snapshot?

ascertrobw avatar Sep 23 '20 15:09 ascertrobw

@ascertrobw You can ignore the then warning as the library only consider if is the keyword and handle the condition syntax properly. Sorry, I missed your comment until today I review the issues.

stevehu avatar Oct 01 '20 12:10 stevehu

Hi, why is the same happening with $comment keyword? This is just non validation keyword from specification so it should be easy to implement it (I did it on my own with NonValidationKeyword).

kmalski avatar Oct 01 '20 15:10 kmalski

@kmalski Would you be able to submit a PR to get it fixed for the $comment? Thanks.

stevehu avatar Oct 01 '20 16:10 stevehu

This was resolved with #539 #696 and #699

fdutton avatar May 22 '23 23:05 fdutton