When the requirements field is (for example) a string, the schema
validation picks it up but the problem is never displayed to the user.
Before the errors and warnings are displayed, metadata-json-lint
attempts to iterate through the requirements which causes an exception
to be raised.
Before:
$ metadata-json-lint test.json
/home/tsharpe/code/metadata-json-lint/lib/metadata_json_lint.rb:137: in
'validate_requirements!': undefined method 'each' for "aoeu":String
(NoMethodError)
After:
$ metadata-json-lint test.json
(ERROR) requirements: The property 'requirements' of type string did not
match the following type: array
Errors found in test.json
When the requirements field is (for example) a string, the schema validation picks it up but the problem is never displayed to the user. Before the errors and warnings are displayed, metadata-json-lint attempts to iterate through the requirements which causes an exception to be raised.
Before:
After: