Closed harrel56 closed 4 months ago
Notes:
General revamp on handling dialects. It supports now cross-dialect references and dynamically infers which dialect should be used based on $schema
value.
There are no direct API changes, only these methods change behavior slightly:
ValidatorFactory.withDisabledSchemaValidation()
- now, setting it to true
does not disable vocabularies semantics as well. It will use vocabularies from Dialect
instances (official or custom if provided). It still guarantees that meta-schemas will not be resolved, so e.g. schemas with "$schema": "http://json-schema.org/draft-03/schema#"
will not fail despite lack of draft3 support.ValidatorFactory.withDialect()
- previously, it served as a hard dialect override, meaning just this one dialect would be used regardless of $schema
keyword. Now, this method registers your custom dialect and can be called multiple times for multiple registrations.There is one new method:
ValidatorFactory.withDefaultDialect()
- it serves similar purpose as ValidatorFactory.withDialect()
previously did. By default, it's set on draf2020-12. It's just a fallback when schema does not contain $schema
keyword.
Quality Gate passed
Issues
0 New issues
4 Accepted issues
Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code
See analysis details on SonarCloud