MobilityData / gbfs

Documentation for the General Bikeshare Feed Specification, a standardized data feed for shared mobility system availability. Maintained by MobilityData
https://gbfs.org
Other
774 stars 282 forks source link

Providing an OpenAPI specification #652

Open dersvenhesse opened 2 weeks ago

dersvenhesse commented 2 weeks ago

Hello, first of all, thank you for directly adding models based on the json-schema in https://github.com/MobilityData/gbfs-json-schema. This helps a lot. Hereby I'd like to suggest another addition to the toolbox: a generic OpenAPI specification for GBFS.

In my knowledge developers often use OpenAPI specification (https://spec.openapis.org/oas/latest.html) to describe their (restful) apis. The brings possibilities to document the usage, add examples, provide additional descriptions, having support for multiple programming languages (similar to json-schema) all while providing consumers an easy-to-use and built-in tryout.

With a pre-existing specification providers only need to update some fields (like servers and info) and have a widely recognized documentation ready. Providers as well as consumers can easily use generators (like https://openapi-generator.tech/) to create code for implementation and usage.

I'd suggest one specification with all feeds combined, but I'm happy to discuss other alternatives. I'd also be happy to provide the first draft if you folks also think this might be a good addition.

richfab commented 2 days ago

Hi @dersvenhesse!

Extending your thanks to @testower, @tdelmas and @Alessandro100 for adding models based on the json-schema 🙏

Thank you for this great suggestion about having a generic OpenAPI specification for GBFS. Would you mind sharing examples of such API for other data standards?

If other members of the community find this useful, please add a 👍 on the issue description like @futuretap.

Thanks!

mplsmitch commented 1 day ago

Would you mind sharing examples of such API for other data standards?

There are OpenAPI descriptions for MDS and CDS.

MDS here: https://github.com/openmobilityfoundation/mds-openapi https://openmobilityfnd.stoplight.io/docs/mds-openapi/gqf2ey431nxzh-about-mds

CDS here: https://github.com/openmobilityfoundation/cds-openapi https://openmobilityfnd.stoplight.io/docs/cds-openapi/83teyinnn1py6-curb-api