Skip to content

196 station status or vehicle status should be required#198

Merged
jcpitre merged 3 commits into
masterfrom
196-station_status-or-vehicle_status-should-be-required
Jul 14, 2026
Merged

196 station status or vehicle status should be required#198
jcpitre merged 3 commits into
masterfrom
196-station_status-or-vehicle_status-should-be-required

Conversation

@jcpitre

@jcpitre jcpitre commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #196 — A GBFS feed must be dock-based, free-floating, or hybrid, meaning at least one of station_status / vehicle_status (v3+) or station_status / free_bike_status (pre-v3) must be present. Previously, the validator accepted feeds with neither file without reporting any error.

Changes

  • GbfsJsonValidator: Added a post-validation check (checkStatusFilePresence) that flags both status files as conditionally required — with 1 error each — when neither is present in the feed.
  • FileValidationResult: Added a conditionallyRequired field to distinguish between files that are always required by the spec and files that are required only when a counterpart is absent.
  • ConsoleReportFormatter: Updated to display [CONDITIONALLY REQUIRED] instead of [REQUIRED] for these files.
  • Tests: Added 4 new test cases covering v3 and pre-v3 feeds for both the missing-both and missing-one scenarios. Updated existing tests to account for the new rule.
  • Example: Updated GbfsValidatorExample to use Loader for feed discovery.

Example

Running against https://opendata.agglo-larochelle.fr/sites/default/files/dataset/2dc/df9ac-ca89-4e3f-af7e-5d75f255ee5e/gbfs.json (the feed mentioned in #196) now produces:

⚠ station_status [CONDITIONALLY REQUIRED] - NOT FOUND
⚠ vehicle_status [CONDITIONALLY REQUIRED] - NOT FOUND
Result: INVALID

@jcpitre jcpitre linked an issue Jul 14, 2026 that may be closed by this pull request

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jcpitre
jcpitre merged commit 33ca9f3 into master Jul 14, 2026
2 checks passed
@jcpitre
jcpitre deleted the 196-station_status-or-vehicle_status-should-be-required branch July 14, 2026 19:23
@testower

Copy link
Copy Markdown
Collaborator

I should have noticed this sooner. This is a redundant check since we already validate this on the gbfs.json schema. The only thing that this PR adds is a check that they are reachable on the network. IMHO this adds unnecessary complexity for something that could fail for other reasons. I believe we discussed this on the tools contributor meeting.

@jcpitre

jcpitre commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@testower we won't release until this is settled (or thrown out)

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.

Station_status or vehicle_status should be required

3 participants