entur / gbfs-validator-java

European Union Public License 1.2
2 stars 1 forks source link

Support for custom rules by schema patching #41

Closed testower closed 1 year ago

testower commented 1 year ago

The whole GBFS specification is not possible to represent statically in the JSON schema. The canonical validator has chosen to solve this by dynamically patching it in runtime, e.g. to solve dependencies between files. This is the same approach taken here:

Each Version instance may be instantiated with a map of custom-rule-lists-per-file. The rule is an implementation of the CustomRuleSchemaPatcher interface, which takes a schema document context and a map of the files being validated. The implementation may then return a modified version of the schema with dynamic rules added to it based on the files being validated.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

95.2% 95.2% Coverage
0.0% 0.0% Duplication