You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a naive question but I have not found any other discussion about it.
I have learned from https://json-schema.org/understanding-json-schema/basics that an empty schema is a valid one. And so jsonschema.validate() does not raise an exception if you pass in an empty value for schema. That's fine, as it is easy enough to first test if the schema argument value is empty or.
But jsonschema.validate() also seems to accept a non-empty schema value that does not contain any useful schema keywords. So when I call jsonschema.validate() how can I be certain that the schema describes some specific properties of an instance?
Afaict the validator check_schema methods ignore unrecognized keywords so a schema full of garbage is no different than an empty one.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a naive question but I have not found any other discussion about it.
I have learned from https://json-schema.org/understanding-json-schema/basics that an empty schema is a valid one. And so jsonschema.validate() does not raise an exception if you pass in an empty value for schema. That's fine, as it is easy enough to first test if the schema argument value is empty or.
But jsonschema.validate() also seems to accept a non-empty schema value that does not contain any useful schema keywords. So when I call jsonschema.validate() how can I be certain that the schema describes some specific properties of an instance?
Afaict the validator check_schema methods ignore unrecognized keywords so a schema full of garbage is no different than an empty one.
Beta Was this translation helpful? Give feedback.
All reactions