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
Currently, the validator cannot validate conditional requirements that apply based on a field from a different file. This can lead to errors in the feeds that cannot be identified or fixed by the producer.
This type of validation was proposed in #106 using imperative rules (in JavaScript). However, using schemas and patched schemas instead, would have the benefit of having the validation done by ajv and all the results as an output of ajv.
Example of conditional requirements based on a field from a different file in the GBFS spec:
default_reserve_time [in vehicle_types.json] | REQUIRED if reservation_price_per_min or reservation_price_flat_rate are defined [in system_pricing_plans.json]
Please describe some potential solutions you have considered (even if they aren’t related to GBFS).
Conditional requirements based on a field from a different file could be validated using JSON Schema patching #Required Properties.
As noted in #153 (comment), a solution to reduce schema patching complexity could be to generate new schemas via a builder or a template instead of patching the main schemas.
Fields with conditional requirements based on a different file
What is the issue and why is it an issue?
Currently, the validator cannot validate conditional requirements that apply based on a field from a different file. This can lead to errors in the feeds that cannot be identified or fixed by the producer.
This type of validation was proposed in #106 using imperative rules (in JavaScript). However, using schemas and patched schemas instead, would have the benefit of having the validation done by ajv and all the results as an output of ajv.
Example of conditional requirements based on a field from a different file in the GBFS spec:
Please describe some potential solutions you have considered (even if they aren’t related to GBFS).
Conditional requirements based on a field from a different file could be validated using JSON Schema patching #Required Properties.
As noted in #153 (comment), a solution to reduce schema patching complexity could be to generate new schemas via a builder or a template instead of patching the main schemas.
Fields with conditional requirements based on a different file
The text was updated successfully, but these errors were encountered: