generate typed client models from the official gbfs json schemas instead of hand-rolling types

domain: github.com/MobilityData · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Pull the versioned schema files from the gbfs-json-schema repo (organized by version folder, e.g. v2.3, v3.0) rather than reverse-engineering types from example payloads.
  2. Use a JSON-Schema-to-code generator for your target language to produce data models directly from those schemas.
  3. Regenerate models whenever you bump the GBFS version you consume/produce, so schema changes (e.g. renamed fields between versions) propagate automatically instead of silently drifting.
  4. Validate a sample feed against the same schema version your generated models target, to catch mismatches between the schema version and the live feed's declared version field.
  5. Check MobilityData's toolbox/resources listing (linked from gbfs.org) for already-published community libraries before generating your own, in case one already exists for your language.

Known gotchas

Related routes

Configure Confluent Schema Registry compatibility modes for JSON Schema and Protobuf subjects
data-engineering · 5 steps · unrated
model a mixed bicycle, cargo bike, scooter, and car fleet in a gbfs 3.0 vehicle_types.json feed
gbfs.org · 6 steps · unrated
automate gbfs feed validation in CI using the gbfs-validator api instead of the web UI
gbfs-validator.mobilitydata.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans