feat(contracts): canonical /v1 OpenAPI contract — fix #106, align #109 - #116
Open
taylormade7978 wants to merge 1 commit into
Open
feat(contracts): canonical /v1 OpenAPI contract — fix #106, align #109#116taylormade7978 wants to merge 1 commit into
taylormade7978 wants to merge 1 commit into
Conversation
Single source of truth reconciling the PWA client (web/src/api/types.ts) and the Rust server (crates/server/src/http) /v1 shapes that diverged in #106. REST-only, camelCase, {data}/{error} envelope matching envelope.rs. Establishes the contract the server + client conform to; retires the parallel Node services/data GraphQL shim (#107/#115) once every resource is migrated. Adds contracts/openapi/{made-v1.yaml,README.md} with the per-resource migration plan that keeps main green and the app working at each step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Why
Closes the design half of #106: the PWA client and the Rust server were built to divergent
/v1shapes (different routes and different DTOs), so the data screens 404 / fail to parse. There is no shared contract enforcing either side.Realises the #109 decision — one canonical Rust engine serves the app. The reconciliation is REST-only against
crates/server; the transitional Nodeservices/dataGraphQL shim (#107/#115) is retired once every resource is migrated.What's here
contracts/openapi/made-v1.yaml— OpenAPI 3.1, the single source of truth. 11 paths, 27 schemas, across catalog / collection / leaderboard / shop / story.contracts/openapi/README.md— decisions + the per-resource migration plan.No behaviour change in this PR — it's the contract + plan the follow-ups conform to.
Decisions captured
camelCase, client-shaped field names (they already mirror the Rust domain aggregates).crates/server/src/http/envelope.rs: 2xx ={ "data": … }, errors ={ "error": { code, message, details? } }. Path schemas describe the payload underdata.Migration plan (each step keeps
maingreen + the app working)GET /catalog/cards,GET /catalog/expansions+ enriched DTOsGET /collection/{playerId},PUT …/decks/{deckId}GET /leaderboard(default season)GET /shop/items,POST/GET /shop/ordersGET /story/{playerId}/missions,POST …/attempts(seeded campaign served from Rust, mirroring feat(data): real story-missions campaign (#114) #115)services/data,web/src/api/graphql.ts,graphqlUrl; close feat(data): async data service — GraphQL queries + WS subscriptions + REST mutations #107/feat(data): real story-missions campaign (#114) #115 as superseded, Frontend and backend ship divergent /v1 API contracts — data screens 404 #106 as fixed.Un-migrated resources keep using the still-deployed shim, so nothing breaks mid-migration.
Refs #106, #109, #107, #115.
🤖 Generated with Claude Code