Validate conditional presence of station/vehicle feeds in gbfs.json - #208
Merged
jcpitre merged 1 commit intoAug 14, 2026
Merged
Conversation
testower
marked this pull request as draft
July 24, 2026 11:35
testower
force-pushed
the
validate-conditional-feed-presence
branch
from
July 24, 2026 11:45
c53535c to
a4c2dba
Compare
Encode two spec rules on the gbfs.json feeds array, as an allOf sibling of the existing system_information `contains` constraint, using draft-07 contains + anyOf/if/then: * At least one of station_status or the free-floating feed (vehicle_status in v3.x, free_bike_status in v2.x) must be present. * If station_information is declared, station_status must also be declared. Applied to v2.0-v2.3, v3.0 and v3.1-RC3. The keywords are validation-only, so generated TS/Go/Java models are unaffected. testFixtures/v3.1-RC3/gbfs.json declared station_information without station_status (now invalid) and gains the missing station_status entry. Closes MobilityData#180
testower
force-pushed
the
validate-conditional-feed-presence
branch
from
July 24, 2026 11:53
a4c2dba to
eccc143
Compare
testower
marked this pull request as ready for review
July 24, 2026 11:57
richfab
approved these changes
Jul 27, 2026
Contributor
There was a problem hiding this comment.
Thank you @testower for this great addition to the GBFS JSON Schemas!
The manual tests I ran with https://www.jsonschemavalidator.net/ passed for all versions.
LGTM! I will let the dev team take care of the merge.
jcpitre
approved these changes
Aug 14, 2026
jcpitre
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
I would like to know more about this 30-case validation harness
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #180
What
Adds two conditional feed-presence rules to the
gbfs.jsonfeedsarray, as anallOfsibling of the existingsystem_informationcontainsconstraint, using draft-07contains+anyOf/if/then:feedsMUST contain at least one ofstation_statusor the free-floating feed (vehicle_statusin v3.x,free_bike_statusin v2.x).station_informationis declared,station_statusMUST also be declared.Applied to v2.0, v2.1, v2.2, v2.3, v3.0, v3.1-RC3.
Notes
testFixtures/v3.1-RC3/gbfs.jsondeclaredstation_informationwithoutstation_status(now invalid under rule 2, and consumed by the TypeScript test) and gains the missingstation_statusentry.Verification