mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
fix: move 5 path-param endpoints to query params for Vercel routing (#472)
Vercel's `api/[domain]/v1/[rpc].ts` captures one dynamic segment.
Path params like `/get-humanitarian-summary/SA` add an extra segment
that has no matching route file, causing 404 on both OPTIONS preflight
and direct requests. These endpoints were broken in production.
Changes:
- Remove `{param}` from 5 service.proto HTTP paths
- Add `(sebuf.http.query)` annotations to request message fields
- Update generated client/server code to use URLSearchParams
- Update OpenAPI specs (YAML + JSON) to declare query params
- Add early-return guards in 4 handlers for missing required params
- Add happy.worldmonitor.app to runtime.ts redirect hosts
Affected endpoints:
- GET /api/conflict/v1/get-humanitarian-summary?country_code=SA
- GET /api/economic/v1/get-fred-series?series_id=T10Y2Y&limit=120
- GET /api/market/v1/get-country-stock-index?country_code=US
- GET /api/intelligence/v1/get-country-intel-brief?country_code=US
- GET /api/military/v1/get-aircraft-details?icao24=a12345
This commit is contained in:
@@ -116,7 +116,7 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/api/military/v1/get-aircraft-details/{icao24}:
|
||||
/api/military/v1/get-aircraft-details:
|
||||
get:
|
||||
tags:
|
||||
- MilitaryService
|
||||
@@ -125,7 +125,7 @@ paths:
|
||||
operationId: GetAircraftDetails
|
||||
parameters:
|
||||
- name: icao24
|
||||
in: path
|
||||
in: query
|
||||
description: ICAO 24-bit hex address (lowercase).
|
||||
required: true
|
||||
schema:
|
||||
|
||||
Reference in New Issue
Block a user