| title | OpenAPI 3.2: Add native QUERY HTTP method support | ||
|---|---|---|---|
| parentIssue | 1673 | ||
| labels |
|
||
| assignees | |||
| milestone |
OpenAPI 3.2 formally adds QUERY as a first-class HTTP method alongside GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH, and TRACE. The QUERY method is safe and idempotent but allows a request body, making it useful for complex search and filter operations.
HttpMethods in src/server/registry.ts and HTTP_METHODS in src/migrate/update-route-types.ts do not include QUERY. The Koa layer, dispatcher, and migration helper would all need updating.
- Add
"query"toHttpMethodsinsrc/server/registry.ts - Add
"QUERY"toALL_HTTP_METHODS(or equivalent) insrc/migrate/update-route-types.ts - Ensure the Koa middleware forwards
QUERYrequests to the matching handler - Ensure the dispatcher routes
QUERYrequests correctly - The code generator already iterates over all keys in a path definition, so generation should work automatically once the server recognises the method
- A
queryoperation defined in an OpenAPI 3.2 spec generates a corresponding route handler file - A
QUERYHTTP request is routed to the correct handler and returns the expected response - The migration helper recognises
QUERYwhen updating existing route files - Existing routes using other HTTP methods are unaffected
- Unit tests cover the new
QUERYmethod in the registry, dispatcher, and migration helper