MobilityData / gbfs-json-schema

JSON Schema for GBFS feeds, managed by MobilityData. The versions are organized by folders. CC BY 4.0
Apache License 2.0
23 stars 25 forks source link

Host language bindings for gbfs #96

Open testower opened 11 months ago

testower commented 11 months ago

The topic of improving data quality has been discussed in different forums. At the North America workshop in October -23, the GBFS group agreed that encouraging the use of schema-generated language bindings was a low hanging fruit that could potentially significantly improve the general quality baseline among GBFS producers, while making GBFS easier to consume at the same time.

"Language binding" is a vague term, but can be generally understood as a bridge between serialised GBFS data (the JSON stuff) and some programming-language-specific internal representation of that data.

I propose that this repository is extended to host language bindings for commonly used programming languages. These language bindings must automatically generated from the schema whenever the schema is updated, and published to their respective package repository (e.g. NPM for TypeScript, Maven Central for Java).

Beyond this, I would like to ask the community what other languages are in use for producing / consuming GBFS and if there are already existing initiatives out there in the wild for generating language bindings. This issue will serve as a way to catalogue these if they exist and track the progress of adding language bindings and the necessary processes to maintain and publish them, the this repository.

cc @josee-sabourin @richfab

testower commented 9 months ago

Rust: https://crates.io/crates/gbfs_types by fluctuo / @tdelmas

tdelmas commented 9 months ago

I would really like to see a way to automate the generation of types bindings and json schemas from the documentation (or the other way around). I feel that https://github.com/MobilityData/gbfs/pull/576 could bring us closer.

testower commented 9 months ago

@tdelmas I have been arguing in favor of generating documentation from the json schemas and treat the json schema as the official spec. The problem is that the spec has a lot of elements in it that is difficult or impossible to encode in the schema. So that's the main problem. That said, automating generation of type bindings from the schema is easy. We already do that with the java bindings.

emmambd commented 5 months ago

Reference document to investigate and complete this:

https://json-schema.org/implementations#generators-from-schemas