-
Notifications
You must be signed in to change notification settings - Fork 57
Syntax checking
Define a customizable syntax checking strategy. Detect a number of ill-defined, but legal, schemas.
- Allow to reject unknown $schemas.
- Allow to reject various "id" mishandlings.
- Allow to reject unknown keywords.
- Allow to do "recursive" checking (ie, download referenced schemas if need be).
- Allow a "fail fast" mode.
Suggested name: SchemaSyntaxOption
, interface; default implementation DefaultSchemaSyntaxOption
.
By default, only the syntax of embedded JSON References is checked; this option causes the process to load schemas at these references and validate them, recursively so.
This option cannot be enabled at the same time than STOP_AT_FIRST_SYNTAX_ERROR
.
By default, the syntax of the whole schema will be checked; this option causes the process to stop as soon as a syntax error is encountered.
This option cannot be enabled at the same time than DEREFERENCE_EXTERNAL_SCHEMAS
.
When this option is active, the syntax process will declare failure if it encounters a $schema
it has no knowledge of.
If this option is inactive, the default $schema
will be used.
When this option is active, the syntax process will declare failure if it cannot find a $schema
at the top level of a schema.
When this option is active, syntax validation will raise an error if unknown keywords are encountered in the schema. When inactive, only a warning will be emitted.
Since the specification explicitly allows any object member other than schema keywords in a JSON Schema, this option is disabled by default.
"id"s can be written so that a resolution scope is duplicated within a schema; when this option is active, syntax validation will fail if it detects a duplicate resolution scope.
"id"s can be written so that a resolution scope is an invalid JSON Reference; if this option is enabled, such an occurrence will raise a syntax error.
TODO