Skip to content

docs(api): propagate proto required → OpenAPI parameter required:true (#4599) #4604

Description

@koala73

Problem

The sebuf protoc-gen-openapiv3 generator hardcodes required:false on every query parameter — 340/341 across the surface (only 1 is required:true). So parameters the handler treats as effectively required are documented as optional, and the request component schema's required:[…] array is contradicted by the parameter object (e.g. AnalyzeStockRequest.required:[symbol] vs the symbol query param required:false). Consumers omit them and get an empty/error 200 with no signal.

Single upstream fix

Make the generator read the proto field's requiredness (buf.validate.field.required / the (sebuf.http.query) annotation) and set the OpenAPI parameter required:true accordingly; regenerate. One codegen change flips ~30 params at once and removes the parameter-vs-component contradiction. If the external plugin can't be configured, apply it via the post-generation injector shipped in #4602.

Confirmed effectively-required params (marked required:false today)

  • Aviation get-flight-statusflight_number
  • Conflict get-humanitarian-summarycountry_code
  • ConsumerPrices list-consumer-price-moverslimit (omitted → 0 results, contradicts documented default 10)
  • Economic get-bls-series / get-fred-seriesseries_id; list-world-bank-indicatorsindicator_code
  • Imagery search-imagerybbox
  • Infrastructure get-temporal-baselinetype (also a fixed allow-list)
  • Intelligence compute-energy-shockcountry_code; get-country-port-activitycountry_code
  • Leads submit-contactname, organization, phone, email; register-interestturnstileToken
  • Market analyze-stock, backtest-stock, get-insider-transactionssymbol
  • Military list-military-bases, list-military-flights — bbox (also tracked in feat(api/dx): military bbox endpoints return silent empty 200 on missing/all-zero bbox — surface 400 or debug header #4595)
  • News summarize-article-cachecache_key
  • Sanctions lookup-sanction-entityq
  • Scenario get-scenario-statusjobId (handler 400s on missing)
  • SupplyChain (8) — iso2 / chokepointId / fromIso2 / toIso2 on get-chokepoint-history, get-bypass-options, get-country-cost-shock, get-multi-sector-cost-shock, get-country-products, get-route-impact, get-country-chokepoint-index, get-sector-dependency, get-route-explorer-lane
  • Webcam get-webcam-imagewebcam_id

Acceptance criteria

Part of the umbrella audit #4599. Sibling workstreams: #4595 (bbox 400/router), #4602 (auth — in flight).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: APIBackend API, sidecar, keysenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions