"Unknown keyword then" / "else" warning
It seems that if I have "then" or "else" in my schema I get a warning when loading the schema:
15:30:49.523 [main] WARN com.networknt.schema.JsonMetaSchema - Unknown keyword then - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
I think this is because ValidatorTypeCode.getNotFormatKeywords only includes if not else or then.
Could simply fix this by listing "then" and "else" as keywords with the TrueValidator. Happy to do this if you think it would be helpful?
@Gaff This would be a fantastic idea if it works. What we need to do is to add two more entries into the ValidatorTypeCode. I don't know if it works though as there would be multiple TrueValidator instances in the mapping.
Some of the PRs fixed part of the issues by adding the keyword to the NonValidationKeyword here at
https://github.com/networknt/json-schema-validator/blob/master/src/main/java/com/networknt/schema/JsonMetaSchema.java#L172
I am wondering if we can add the else using the same way. Could you please try it out and submit a PR if it works?
Hi, Just fyi, I'm still getting these warnings....
Unknown keyword then - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
Unknown keyword else - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
I think this has been fixed for all versions.