Skip to content

Support for custom rules by schema patching#41

Merged
testower merged 22 commits intomasterfrom
custom-validation-rules
Jun 13, 2023
Merged

Support for custom rules by schema patching#41
testower merged 22 commits intomasterfrom
custom-validation-rules

Conversation

@testower
Copy link
Copy Markdown
Collaborator

@testower testower commented Jun 9, 2023

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.

@testower testower marked this pull request as ready for review June 12, 2023 13:07
@sonarqubecloud
Copy link
Copy Markdown

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

@testower testower merged commit 53f046e into master Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant