json-schema-validator
json-schema-validator copied to clipboard
How to validate Property in Schema containing Custom Validator only
Hello @stevehu , Can you have a look at this please?
Below is the keyword that is given in the documentation of the custom validator. You can use GroovyKeyword like below: { "type": "object", "properties": { "someProperty": { "type": "string", "groovy": "SomeScript.groovy" }, "someOtherProperty": { } } } Is there any way to validate only someProperty against groovy validator and skip someOtherProperty validation?
Please let me know if its feasible.
Thanks, Piyush Goel
Yes, it is feasible.
Please, make note, that the property in properties section is not equal to keyword, which you have to specify in the custom validator. So in your example, the keyword should be "properties". In that way, you will replace the default PropertiesValidator with your custom, where you are able to select the property to validate.