Skip to content

[feat](api): add clients generated from openapi specs and use them fetch busroutelines - #105

Draft
jumpy-cat wants to merge 5 commits into
navigation-hubfrom
generated-clients
Draft

[feat](api): add clients generated from openapi specs and use them fetch busroutelines#105
jumpy-cat wants to merge 5 commits into
navigation-hubfrom
generated-clients

Conversation

@jumpy-cat

@jumpy-cat jumpy-cat commented Aug 5, 2026

Copy link
Copy Markdown
Member

Description

Been working on end-to-end typesafety between the frontend and the backend, this PR adds the beginnings of that and trials it on the getAllRoutes and getAllRideRoutes routes that I needed to change anyway (moving the logic to the backend, also in this PR, see #98).

To run the frontend you will need to define an extra environment variable BACKEND_OPENAPI_URL, which would have a value similar to what you'd set BACKEND_URL to but without the extra /mbus/api/v3 at the end. Note that the url would have to point at a backend that matches the openapi spec (v2 of the mock backend should work). You will also have to generate the clients first, the ci file should have an up to date version of the commands needed.

It should look something like this (full clean & regenerate):

rm -rf lib/backend
dart run build_runner clean
dart run swagger_parser
dart run build_runner build

Type of Change

  • New feature (feat)
  • Bug fix (fix)
  • Refactor / code improvement
  • Dependency / build update
  • Documentation
  • Other (explain)

Related Issues

Prereq of how I'd like to do #98
Depends on mbusdev/mbus-backend-dev#47

Changes Made

Testing Done

Flutter:

  • Tested on:
    • iOS Simulator
    • Android Emulator (I uncommented a line to reenable the base routes layer and confirmed they still show up)
    • Physical device

Screenshots / Demo (if UI or notification change)

routes still show up! (using locally running backend TODO: test with mock v2)
Screenshot_20260725_185715

Checklist

  • Commit messages follow Conventional Commits
  • PR title follows [type](scope): short description
  • PR target branch is not main and is our current working update branch (e.g. maizebus2.1)
  • No print() / debugPrint() / console.log() left in production code
  • Secrets / keys not committed

@jumpy-cat
jumpy-cat force-pushed the generated-clients branch 2 times, most recently from 72f284b to 5470bcb Compare August 5, 2026 17:42
@jumpy-cat jumpy-cat changed the title feat(api): add clients generated from openapi specs; refactor: move busrouteline computation to backend feat(api): add clients generated from openapi specs and use them fetch busroutelines Aug 17, 2026
@jumpy-cat jumpy-cat changed the title feat(api): add clients generated from openapi specs and use them fetch busroutelines [feat](api): add clients generated from openapi specs and use them fetch busroutelines Aug 20, 2026
@jumpy-cat jumpy-cat self-assigned this Aug 20, 2026
- fixed compiler errors where legs where used caused by the change to
  a sealed class
- made the dio client for the backend a constant
- change the journey repository to use the generated client
- removed legtodisplay because the expanded field it has was unused
  (replaced with normal leg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant