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

Output gbfs-validator version in the HTTP API response #77

Closed AntoineAugusti closed 2 years ago

AntoineAugusti commented 2 years ago

This is a suggestion for an enhancement.

It would be helpful to be able to know the version of the gbfs-validator used when validating a GBFS feed. As this repository evolves, it seems like a good idea to store the specific version used to validate a feed.

Maybe add a field in the summary or add a new meta field?

Sample response ```json { "summary":{ "version":{ "detected":"1.0", "validated":"1.0" }, "hasErrors":false, "errorsCount":0 }, "files":[ { "schema":{ "$schema":"http://json-schema.org/draft-07/schema", "$id":"https://github.com/NABSA/gbfs/blob/v1.0/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":0, "maximum":1924988399 }, "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 }, "data":{ "description":"Response data in the form of name:value pairs.", "type":"object", "patternProperties":{ "^[a-zA-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":{ "type":"string" }, "url":{ "type":"string" } }, "required":[ "name", "url" ] } } }, "required":[ "feeds" ] }, "required":true }, "additionalProperties":false } }, "required":[ "last_updated", "ttl", "data" ] }, "errors":false, "url":"https://saint-etienne-fr-smoove.klervi.net/gbfs/gbfs.json", "version":"1.0", "recommanded":true, "required":false, "exists":true, "file":"gbfs.json", "hasErrors":false, "errorsCount":0 }, { "languages":[ ], "required":false, "exists":false, "file":"gbfs_versions.json", "hasErrors":false, "errorsCount":0 }, { "languages":[ { "body":{ "last_updated":1658923809, "ttl":0, "data":{ "system_id":"Velivert_FR_Saint-Etienne", "language":"en", "name":"Vélivert Saint-Etienne", "timezone":"Europe/Paris" } }, "exists":true, "lang":"en", "url":"https://saint-etienne-gbfs.klervi.net/gbfs/en/system_information.json", "schema":{ "$schema":"http://json-schema.org/draft-07/schema", "$id":"https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#system_informationjson", "description":"Details including system operator, system location, year implemented, URL, contact info, time zone.", "type":"object", "properties":{ "last_updated":{ "description":"Last time the data in the feed was updated in POSIX time.", "type":"integer", "minimum":0, "maximum":1924988399 }, "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 }, "data":{ "description":"Response data in the form of name:value pairs.", "type":"object", "properties":{ "system_id":{ "description":"Identifier for this vehicle share system. This should be globally unique (even between different systems).", "type":"string" }, "language":{ "description":"The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", "type":"string", "pattern":"^[a-z]{2}$" }, "name":{ "description":"Name of the system to be displayed to customers.", "type":"string" }, "short_name":{ "description":"Optional abbreviation for a system.", "type":"string" }, "operator":{ "description":"Name of the operator", "type":"string" }, "url":{ "description":"The URL of the vehicle share system.", "type":"string" }, "purchase_url":{ "description":"URL where a customer can purchase a membership.", "type":"string" }, "start_date":{ "description":"Date that the system began operations.", "type":"string", "format":"date" }, "phone_number":{ "description":"A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", "type":"string" }, "email":{ "description":"Email address actively monitored by the operator's customer service department.", "type":"string" }, "timezone":{ "description":"The time zone where the system is located.", "type":"string" }, "license_url":{ "description":"A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", "type":"string" } }, "required":[ "system_id", "language", "name", "timezone" ] } }, "required":[ "last_updated", "ttl", "data" ] }, "errors":false } ], "required":true, "exists":true, "file":"system_information.json", "hasErrors":false, "errorsCount":0 }, { "languages":[ { "body":{ "last_updated":1658923809, "ttl":0, "data":{ "stations":[ { "station_id":"101", "name":"Châteaucreux", "lat":45.442972, "lon":4.398855, "capacity":32 }, { "station_id":"102", "name":"Chaléassiere", "lat":45.453601, "lon":4.383062, "capacity":16 }, { "station_id":"103", "name":"Carnot", "lat":45.447093, "lon":4.385487, "capacity":24 }, { "station_id":"104", "name":"Jacquard", "lat":45.441888, "lon":4.382492, "capacity":12 }, { "station_id":"105", "name":"Jaures", "lat":45.440725, "lon":4.387295, "capacity":32 }, { "station_id":"106", "name":"Dorian", "lat":45.43836, "lon":4.388435, "capacity":32 }, { "station_id":"107", "name":"Clapier", "lat":45.436903, "lon":4.378789, "capacity":16 }, { "station_id":"108", "name":"Peuple", "lat":45.436265, "lon":4.387539, "capacity":32 }, { "station_id":"109", "name":"A. Thomas", "lat":45.4328, "lon":4.388035, "capacity":16 }, { "station_id":"110", "name":"A. France", "lat":45.43065, "lon":4.389752, "capacity":16 }, { "station_id":"111", "name":"Tardy", "lat":45.427396, "lon":4.386718, "capacity":16 }, { "station_id":"112", "name":"Tréfilerie", "lat":45.427296, "lon":4.390669, "capacity":24 }, { "station_id":"113", "name":"Centre 2", "lat":45.42342, "lon":4.392292, "capacity":24 }, { "station_id":"114", "name":"Bellevue", "lat":45.415579, "lon":4.393322, "capacity":24 }, { "station_id":"115", "name":"Congrès", "lat":45.426972, "lon":4.404048, "capacity":32 }, { "station_id":"116", "name":"Villeboeuf", "lat":45.431808, "lon":4.395127, "capacity":16 }, { "station_id":"117", "name":"Chavanelle", "lat":45.435109, "lon":4.391962, "capacity":24 }, { "station_id":"118", "name":"J. Moulin", "lat":45.437404, "lon":4.392469, "capacity":16 }, { "station_id":"119", "name":"Fourneyron", "lat":45.4395, "lon":4.395669, "capacity":24 }, { "station_id":"120", "name":"St Francois", "lat":45.439538, "lon":4.403407, "capacity":16 }, { "station_id":"121", "name":"Bergson-Odde", "lat":45.45915, "lon":4.382838, "capacity":16 }, { "station_id":"122", "name":"Terrasse", "lat":45.46502, "lon":4.37874, "capacity":16 }, { "station_id":"123", "name":"Marx", "lat":45.422732, "lon":4.409376, "capacity":24 }, { "station_id":"124", "name":"Janin", "lat":45.448458, "lon":4.39492, "capacity":16 }, { "station_id":"125", "name":"Soleil", "lat":45.450015, "lon":4.402351, "capacity":16 }, { "station_id":"126", "name":"Hôp. Nord", "lat":45.479487, "lon":4.362541, "capacity":32 }, { "station_id":"127", "name":"J. Marc", "lat":45.4732778, "lon":4.3665277, "capacity":24 }, { "station_id":"128", "name":"Technopole", "lat":45.457, "lon":4.39241, "capacity":16 }, { "station_id":"129", "name":"Roannelle", "lat":45.4357171, "lon":4.3829931, "capacity":16 }, { "station_id":"130", "name":"Bicentenaire", "lat":45.420286, "lon":4.392776, "capacity":16 }, { "station_id":"131", "name":"Technopole-Christian Cabal", "lat":45.459291, "lon":4.395342, "capacity":16 }, { "station_id":"132", "name":"Manufacture - Le Fil", "lat":45.45168, "lon":4.388004, "capacity":16 } ] } }, "exists":true, "lang":"en", "url":"https://saint-etienne-gbfs.klervi.net/gbfs/en/station_information.json", "schema":{ "$schema":"http://json-schema.org/draft-07/schema", "$id":"https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#station_informationjson", "description":"Details including system operator, system location, year implemented, URL, contact info, time zone.", "type":"object", "properties":{ "last_updated":{ "description":"Last time the data in the feed was updated in POSIX time.", "type":"integer", "minimum":0, "maximum":1924988399 }, "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 }, "data":{ "description":"Array that contains one object per station as defined below.", "type":"object", "properties":{ "stations":{ "type":"array", "items":{ "type":"object", "properties":{ "station_id":{ "description":"Identifier of a station.", "type":"string" }, "name":{ "description":"Public name of the station.", "type":"string" }, "short_name":{ "description":"Short name or other type of identifier.", "type":"string" }, "lat":{ "description":"The latitude of the station.", "type":"number", "minimum":-90, "maximum":90 }, "lon":{ "description":"The longitude fo the station.", "type":"number", "minimum":-180, "maximum":180 }, "address":{ "description":"Address where station is located.", "type":"string" }, "cross_street":{ "description":"Cross street or landmark…the station is located.", "type":"string" }, "region_id":{ "description":"Identifier of the region…the station is located.", "type":"string" }, "post_code":{ "description":"Postal code where station is located.", "type":"string" }, "rental_methods":{ "description":"Payment methods accepted at this station.", "type":"array", "items":{ "type":"string", "enum":[ "KEY", "CREDITCARD", "PAYPASS", "APPLEPAY", "ANDROIDPAY", "TRANSITCARD", "ACCOUNTNUMBER", "PHONE" ] } }, "capacity":{ "description":"Number of total docking …ilable and unavailable.", "type":"integer", "minimum":0 } }, "required":[ "station_id", "name", "lat", "lon" ] } } }, "required":[ "stations" ] } }, "required":[ "last_updated", "ttl", "data" ] }, "errors":false } ], "required":false, "exists":true, "file":"station_information.json", "hasErrors":false, "errorsCount":0 }, { "languages":[ { "body":{ "last_updated":1658923809, "ttl":0, "data":{ "stations":[ { "station_id":"101", "num_bikes_available":13, "num_bikes_disabled":0, "num_docks_available":19, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923637 }, { "station_id":"102", "num_bikes_available":4, "num_bikes_disabled":0, "num_docks_available":12, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658922931 }, { "station_id":"103", "num_bikes_available":6, "num_bikes_disabled":0, "num_docks_available":18, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923242 }, { "station_id":"104", "num_bikes_available":0, "num_bikes_disabled":0, "num_docks_available":12, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923350 }, { "station_id":"105", "num_bikes_available":3, "num_bikes_disabled":0, "num_docks_available":29, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923020 }, { "station_id":"106", "num_bikes_available":7, "num_bikes_disabled":0, "num_docks_available":25, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923443 }, { "station_id":"107", "num_bikes_available":2, "num_bikes_disabled":0, "num_docks_available":14, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923460 }, { "station_id":"108", "num_bikes_available":8, "num_bikes_disabled":0, "num_docks_available":24, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923049 }, { "station_id":"109", "num_bikes_available":2, "num_bikes_disabled":0, "num_docks_available":14, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923788 }, { "station_id":"110", "num_bikes_available":2, "num_bikes_disabled":0, "num_docks_available":14, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923277 }, { "station_id":"111", "num_bikes_available":1, "num_bikes_disabled":0, "num_docks_available":15, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923714 }, { "station_id":"112", "num_bikes_available":2, "num_bikes_disabled":0, "num_docks_available":22, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923459 }, { "station_id":"113", "num_bikes_available":4, "num_bikes_disabled":0, "num_docks_available":20, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923687 }, { "station_id":"114", "num_bikes_available":3, "num_bikes_disabled":0, "num_docks_available":21, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923605 }, { "station_id":"115", "num_bikes_available":12, "num_bikes_disabled":0, "num_docks_available":20, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923584 }, { "station_id":"116", "num_bikes_available":0, "num_bikes_disabled":0, "num_docks_available":16, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923140 }, { "station_id":"117", "num_bikes_available":6, "num_bikes_disabled":0, "num_docks_available":18, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923549 }, { "station_id":"118", "num_bikes_available":6, "num_bikes_disabled":0, "num_docks_available":10, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923444 }, { "station_id":"119", "num_bikes_available":2, "num_bikes_disabled":0, "num_docks_available":22, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923694 }, { "station_id":"120", "num_bikes_available":6, "num_bikes_disabled":0, "num_docks_available":10, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923702 }, { "station_id":"121", "num_bikes_available":3, "num_bikes_disabled":0, "num_docks_available":13, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923510 }, { "station_id":"122", "num_bikes_available":2, "num_bikes_disabled":0, "num_docks_available":14, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923163 }, { "station_id":"123", "num_bikes_available":0, "num_bikes_disabled":0, "num_docks_available":24, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923376 }, { "station_id":"124", "num_bikes_available":3, "num_bikes_disabled":0, "num_docks_available":13, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923789 }, { "station_id":"125", "num_bikes_available":7, "num_bikes_disabled":0, "num_docks_available":9, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923028 }, { "station_id":"126", "num_bikes_available":5, "num_bikes_disabled":0, "num_docks_available":27, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923341 }, { "station_id":"127", "num_bikes_available":6, "num_bikes_disabled":0, "num_docks_available":18, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923245 }, { "station_id":"128", "num_bikes_available":2, "num_bikes_disabled":0, "num_docks_available":14, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923709 }, { "station_id":"129", "num_bikes_available":0, "num_bikes_disabled":0, "num_docks_available":16, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923235 }, { "station_id":"130", "num_bikes_available":0, "num_bikes_disabled":0, "num_docks_available":16, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923578 }, { "station_id":"131", "num_bikes_available":9, "num_bikes_disabled":0, "num_docks_available":7, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923479 }, { "station_id":"132", "num_bikes_available":3, "num_bikes_disabled":0, "num_docks_available":13, "is_installed":1, "is_renting":1, "is_returning":1, "last_reported":1658923091 } ] } }, "exists":true, "lang":"en", "url":"https://saint-etienne-gbfs.klervi.net/gbfs/en/station_status.json", "schema":{ "$schema":"http://json-schema.org/draft-07/schema", "$id":"https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#station_statusjson", "description":"Describes the capacity and rental availability of the station", "type":"object", "properties":{ "last_updated":{ "description":"Last time the data in the feed was updated in POSIX time.", "type":"integer", "minimum":0, "maximum":1924988399 }, "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 }, "data":{ "description":"Array that contains one object per station as defined below.", "type":"object", "properties":{ "stations":{ "type":"array", "items":{ "type":"object", "properties":{ "station_id":{ "description":"Identifier of a station.", "type":"string" }, "num_bikes_available":{ "description":"Number of vehicles of any type physically available for rental at the station.", "type":"integer", "minimum":0 }, "num_bikes_disabled":{ "description":"Number of disabled vehic…ny type at the station.", "type":"integer", "minimum":0 }, "num_docks_available":{ "description":"Number of functional doc…sically at the station.", "type":"integer", "minimum":0 }, "num_docks_disabled":{ "description":"Number of empty but disabled docks at the station.", "type":"integer", "minimum":0 }, "is_installed":{ "description":"Is the station currently on the street?", "oneOf":[ { "type":"boolean" }, { "type":"number" } ] }, "is_renting":{ "description":"Is the station currently renting vehicles?", "oneOf":[ { "type":"boolean" }, { "type":"number" } ] }, "is_returning":{ "description":"Is the station accepting vehicle returns?", "oneOf":[ { "type":"boolean" }, { "type":"number" } ] }, "last_reported":{ "description":"The last time this station reported its status to the operator's backend in POSIX time.", "type":"number" } }, "required":[ "station_id", "num_bikes_available", "num_docks_available", "is_installed", "is_renting", "is_returning", "last_reported" ] } } }, "required":[ "stations" ] } }, "required":[ "last_updated", "ttl", "data" ] }, "errors":false } ], "required":false, "exists":true, "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 } ] } ```
AntoineAugusti commented 2 years ago

@PierrickP Just checking, at the moment is it possible to rely on the commit SHA on master to know the deployed version? The repo is deployed automatically when something is merged on master?

https://github.com/etalab/transport-site/pull/2554#issuecomment-1219240970