Open MSAdministrator opened 1 year ago
I think it is because you are using strict
:
JSON::Validator.validate!(schema, yaml, :strict => true, :clear_cache => true)
The strict
option does two things:
Because of number 1, it will ignore what you set in the required
field. All fields are required regardless.
In the future, you might want to take advantage of this new feature in json-schema
: https://github.com/voxpupuli/json-schema/pull/494. You might want to use noAdditionalProperties
instead of strict
.
Hello, I have written a JSON Schema for a project and currently is failing to validate stating that property (
input_arguments
) basically should be present but it is not required.Schema
Here is the JSON Schema (in yaml):
Test Data
Here is a test JSON data that should be validated against the schema (above).
Error
The error received is
Code
Here is a ruby script to run the validation
Any help would be appreciated!