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

vehicle_types.json wrongly required #85

Closed PierrickP closed 2 years ago

PierrickP commented 2 years ago

I suspect that this change broke https://github.com/MobilityData/gbfs-validator/pull/41. For v2.2 feeds the vehicle_types.json is thought to be required again, even if the criteria stated in gbfs.md

REQUIRED of systems that include information about vehicle types in the free_bike_status file.

is not given.

Example feed: https://gbfs-validator.netlify.app/?url=https%3A%2F%2Fgbfs.nextbike.net%2Fmaps%2Fgbfs%2Fv2%2Fnextbike_le%2Fgbfs.json which states

Missing file and required

for the vehicle_types.json.

Should I open a new issue?

Best regards

Originally posted by @nbdh in https://github.com/MobilityData/gbfs-validator/issues/63#issuecomment-1255072227

PierrickP commented 2 years ago

This line impact the requirement of the file for the nextbike feed https://github.com/MobilityData/gbfs-validator/blob/3a3cd865a7884744f80df36a88d2f0f76c92bce1/gbfs-validator/gbfs.js#L522

hasBikesStationId is true.

Should we require vehicle_types.json if there are station_id ?

nbdh commented 2 years ago

Thanks for creating this and for pointing to the corresponding piece of code.

Not sure if I should feel addressed by the question, but according to my understanding, the relation is the other way round:

station_id in free_bike_status is:

REQUIRED only if the vehicle is currently at a station and the vehicle_types.json file has been defined.

(Source)

while station_id being present does not mean the vehicle_type.json becomes required.

--

Side note regarding https://github.com/MobilityData/gbfs-validator/blob/3a3cd865a7884744f80df36a88d2f0f76c92bce1/gbfs-validator/gbfs.js#L522 freeBikeStatusHasVehicleId rather means freeBikeStatusHasVehicleTypeId, right?

PierrickP commented 2 years ago

Yeah, I'm pretty sure the condition is not right

It's a bit complex. The file is required if some fields are defined and in the other way, if the file is defined, it required the fields.