Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gbfs.json present, all other files missing, validator says "valid" #127

Closed
derhuerst opened this issue Sep 7, 2023 · 2 comments · Fixed by #169
Closed

gbfs.json present, all other files missing, validator says "valid" #127

derhuerst opened this issue Sep 7, 2023 · 2 comments · Fixed by #169
Assignees
Labels
bug Something isn't working

Comments

@derhuerst
Copy link

derhuerst commented Sep 7, 2023

The GBFS validator validates a GBFS gbfs.json autodiscovery URL that references non-existent files (URLs resulting in404).

I have prepared an invalid feed consisting of just a gbfs.json at https://stuff.jannisr.de/gbfs-validator/gbfs.json. The validator currently responds with "valid".

Observed Expected
Screenshot 2023-09-15 at 11 49 14 Screenshot 2023-09-15 at 11 49 14
@PierrickP PierrickP added the bug Something isn't working label Sep 7, 2023
@richfab
Copy link
Contributor

richfab commented Sep 15, 2023

Thank you @derhuerst for reporting this issue!
I took the liberty to add screenshots to the issue description. Please let me know if I misrepresented the problem.
Feel free to assign yourself to the issue if you would like to work on a fix.
Thank you!

@richfab
Copy link
Contributor

richfab commented Jan 5, 2024

Details shared by @AntoineAugusti in duplicate issue #166:

What is the issue and why is it an issue?

When validating a feed with a missing required file, the summary section of the JSON response has hasErrors: false.

We're using the summary payload to get an idea of the number of errors for a feed and a missing required feeds should not be valid.

Example feed: https://api.prod.partners-fs37hd8.zoov.eu/gbfs/2.2/brest/en/gbfs.json?&key=OGNhZDNjMDQtYTA0Yi00NzU2LWE0MTItOGJlYzE1Y2E4NGEx

Details
{"summary":{"validatorVersion":"1.0.0","version":{"detected":"2.2","validated":"2.2"},"hasErrors":false,"errorsCount":0},"files":[{"schema":{"$schema":"http://json-schema.org/draft-07/schema","$id":"https://github.com/MobilityData/gbfs/blob/v2.2/gbfs.md#gbfsjson","description":"Auto-discovery file that links to all of the other files published by the system.","type":"object","properties":{"last_updated":{"description":"Last time the data in the feed was updated in POSIX time.","type":"integer","minimum":1450155600},"ttl":{"description":"Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).","type":"integer","minimum":0},"version":{"description":"GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).","type":"string","const":"2.2"},"data":{"description":"Response data in the form of name:value pairs.","type":"object","patternProperties":{"^[a-z]{2,3}(-[A-Z]{2})?$":{"type":"object","properties":{"feeds":{"description":"An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.","type":"array","items":{"type":"object","properties":{"name":{"description":"Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.","type":"string","enum":["gbfs","gbfs_versions","system_information","vehicle_types","station_information","station_status","free_bike_status","system_hours","system_alerts","system_calendar","system_regions","system_pricing_plans","geofencing_zones"]},"url":{"description":"URL for the feed.","type":"string","format":"uri"}},"required":["name","url"]}}},"required":["feeds"]}},"minProperties":1,"additionalProperties":false}},"required":["last_updated","ttl","version","data"]},"errors":false,"url":"https://api.prod.partners-fs37hd8.zoov.eu/gbfs/2.2/brest/en/gbfs.json?&key=OGNhZDNjMDQtYTA0Yi00NzU2LWE0MTItOGJlYzE1Y2E4NGEx","version":"2.2","recommended":true,"required":true,"exists":true,"file":"gbfs.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"gbfs_versions.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":true,"exists":false,"file":"system_information.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"vehicle_types.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"station_information.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"station_status.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"free_bike_status.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"system_hours.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"system_calendar.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"system_regions.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"system_pricing_plans.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"system_alerts.json","hasErrors":false,"errorsCount":0},{"languages":[],"required":false,"exists":false,"file":"geofencing_zones.json","hasErrors":false,"errorsCount":0}]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment