MobilityData / gbfs-validator

The canonical GBFS validator. Maintained by the GBFS community, facilitated by MobilityData.
https://gbfs-validator.mobilitydata.org/
Apache License 2.0
18 stars 12 forks source link

Summary hasErrors: false when missing a required file #166

Closed AntoineAugusti closed 7 months ago

AntoineAugusti commented 7 months ago

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 ```json {"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}]} ```
richfab commented 7 months ago

Thank you @AntoineAugusti for creating this issue with such details. This is very helpful. This issue was raised in https://github.com/MobilityData/gbfs-validator/issues/127. I will merge both issues and ping the dev team about it.

richfab commented 7 months ago

Duplicate of https://github.com/MobilityData/gbfs-validator/issues/127