Repository navigation
Add a developer guide, an OpenAPI spec and search examples - #7
Merged
Merged
Conversation
Anyone can now build on the public API without reading the build code: endpoints, the compact format with decoders in JS and Python, caching, licences and the credit each operator asks for, and a stability promise for /v1/. docs/openapi.yaml describes every file and was checked against a fixture build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: someone wanting to build on the API had to read
docs/format.mdand the build code to learn the endpoints, decode the compact format, and work out what they may do with the data.After:
docs/developers.mdis a single page for them, linked from the README. It covers a quick start, every endpoint, the compact format with copyable decoders in JS and Python, what the fields mean (local times, per-operator station ids,seatKnown), freshness and caching, the MAX seat archive, a licence and credit line per operator, and a stability promise for/v1/.docs/openapi.yaml(OpenAPI 3.1) describes every file for Swagger UI, Postman or code generators.examples/search.mjsandexamples/search.pysearch one day between two stations with no dependencies.The promise to review before merging:
/v1/only gets additive changes; clients ignore unknown keys and any element after the seventh in a compact train; a breaking change ships as/v2/with/v1/kept published for at least 6 months.How: docs and example files only, plus six lines in the README. Nothing in
src/or the workflows changes, and the branch merges cleanly with #6 (which should addgbandseto the guide's licence table when it lands). Checked: the spec validates as OpenAPI 3.1; every file of the fixture build and a fixture MAX archive validate against its schemas; both examples return the expected trains against the fixture build served locally;npm run checkpasses. CORS and cache headers are GitHub Pages' standard behaviour and weren't confirmed against the live site.