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:
Elie Habib
2026-02-27 21:01:05 +04:00
committed by GitHub
parent 6a85d42fda
commit 248bdad6ae
35 changed files with 73 additions and 64 deletions

View File

@@ -3,7 +3,7 @@ info:
title: EconomicService API
version: 1.0.0
paths:
/api/economic/v1/get-fred-series/{series_id}:
/api/economic/v1/get-fred-series:
get:
tags:
- EconomicService
@@ -12,7 +12,7 @@ paths:
operationId: GetFredSeries
parameters:
- name: series_id
in: path
in: query
description: FRED series ID (e.g., "GDP", "UNRATE", "CPIAUCSL").
required: true
schema: