Skip to content

feat(maps): accept travel time matrices in flatbuffers - #2876

Open
larsbeck wants to merge 2 commits into
TimefoldAI:mainfrom
larsbeck:maps/accept-flatbuffers
Open

larsbeck wants to merge 2 commits into
TimefoldAI:mainfrom
larsbeck:maps/accept-flatbuffers

Conversation

@larsbeck

@larsbeck larsbeck commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What changes

The maps service client now sends Accept: application/x-flatbuffers, application/json for POST /v1/distances and GET /v1/distances.

  • A maps service that can return OSRM table responses in flatbuffers does so only when the request asks for it.
  • Older maps services only produce JSON, so they ignore the flatbuffers type and answer in JSON, as today.
  • Release this change only together with the support for reading flatbuffers responses.

MapServiceApi.APPLICATION_FLATBUFFERS holds the media type. Revapi reports the changed @Produces values; revapi-differences.json records them with a justification.

Tests

  • New TravelTimeMatrixEnricherAcceptHeaderTest: enriches a model twice (a full matrix request and an update request) against the WireMock map service and checks that both requests accept flatbuffers and JSON. Without the @Produces change, the test fails.
  • service-integration and service-client: all tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UUczJSzTQ9zXe1wLE2raD9

@larsbeck
larsbeck marked this pull request as ready for review December 4, 2026 12:37
@larsbeck
larsbeck requested a review from a team December 4, 2026 12:37
Copilot AI balanced review requested due to automatic review settings December 4, 2026 12:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The required enterprise OSRM converter change must ship in the same release but remains unverified, and JSON-only tests do not validate FlatBuffers decoding for full and update responses.

No open issues 🎉

What changed in this PR

Updates the maps service client to request FlatBuffers travel-time matrices while retaining JSON support. Release must align with the enterprise converter update.

Changes:

  • Advertises both formats for full-matrix and update requests.
  • Records the annotation changes in Revapi.
  • Adds tests for both requests’ Accept headers.
File Description
service/​maps/​service-integration/​src/​main/​java/​ai/​timefold/​solver/​service/​maps/​service/​integration/​internal/​MapServiceApi.java Adds the FlatBuffers media type to distance requests.
service/​maps/​service-integration/​src/​build/​revapi-differences.json Documents accepted annotation changes.
service/​maps/​service-client/​src/​test/​java/​ai/​timefold/​solver/​service/​maps/​service/​client/​api/​TravelTimeMatrixEnricherAcceptHeaderTest.java Checks FlatBuffers and JSON headers for full and update requests.

Review effort: Balanced

The maps service client now sends "Accept: application/x-flatbuffers,
application/json" for the travel time and distance requests. A maps
service that can return OSRM table responses in flatbuffers does so only
when the request asks for it; older maps services ignore the header and
answer in JSON.
@larsbeck
larsbeck force-pushed the maps/accept-flatbuffers branch from 0d74401 to f90357a Compare December 4, 2026 13:16
@larsbeck
larsbeck requested review from jennedebleser and a balanced review from Copilot December 4, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The PR description lacks the Javadoc build result and confirmation of successful completion for service/maps/service-integration.

1 open issue

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants