Skip to content

Commit 2d017f2

Browse files
doramirdorclaude
andcommitted
fix: exclude SPA catch-all route from OpenAPI schema to fix type drift CI
The /{full_path} SPA route was conditionally registered (only when frontend/dist exists), causing generated types to differ between local (with dist) and CI (without dist). Adding include_in_schema=False ensures consistent type generation regardless of environment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f0df54 commit 2d017f2

2 files changed

Lines changed: 1 addition & 52 deletions

File tree

backend/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ async def get_version():
477477
)
478478

479479
# SPA catch-all: serve index.html for all non-API, non-asset routes
480-
@app.get("/{full_path:path}")
480+
@app.get("/{full_path:path}", include_in_schema=False)
481481
async def serve_spa(full_path: str):
482482
"""Serve the SPA index.html for client-side routing."""
483483
file_path = _frontend_dist_path / full_path

frontend/src/types/generated.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,26 +3269,6 @@ export interface paths {
32693269
patch?: never;
32703270
trace?: never;
32713271
};
3272-
"/{full_path}": {
3273-
parameters: {
3274-
query?: never;
3275-
header?: never;
3276-
path?: never;
3277-
cookie?: never;
3278-
};
3279-
/**
3280-
* Serve Spa
3281-
* @description Serve the SPA index.html for client-side routing.
3282-
*/
3283-
get: operations["serve_spa__full_path__get"];
3284-
put?: never;
3285-
post?: never;
3286-
delete?: never;
3287-
options?: never;
3288-
head?: never;
3289-
patch?: never;
3290-
trace?: never;
3291-
};
32923272
}
32933273
export type webhooks = Record<string, never>;
32943274
export interface components {
@@ -11174,35 +11154,4 @@ export interface operations {
1117411154
};
1117511155
};
1117611156
};
11177-
serve_spa__full_path__get: {
11178-
parameters: {
11179-
query?: never;
11180-
header?: never;
11181-
path: {
11182-
full_path: string;
11183-
};
11184-
cookie?: never;
11185-
};
11186-
requestBody?: never;
11187-
responses: {
11188-
/** @description Successful Response */
11189-
200: {
11190-
headers: {
11191-
[name: string]: unknown;
11192-
};
11193-
content: {
11194-
"application/json": unknown;
11195-
};
11196-
};
11197-
/** @description Validation Error */
11198-
422: {
11199-
headers: {
11200-
[name: string]: unknown;
11201-
};
11202-
content: {
11203-
"application/json": components["schemas"]["HTTPValidationError"];
11204-
};
11205-
};
11206-
};
11207-
};
1120811157
}

0 commit comments

Comments
 (0)