Is your feature request related to a problem? Please describe.
The HTTP QUERY method (RFC 10008) has no representation in spec. PathItemProps only has get/put/post/delete/options/head/patch, so a QUERY endpoint can't be documented or round-tripped. This blocks downstream tooling (swaggo/swag#2193).
Describe the solution you'd like
Add a Query field to PathItemProps:
Patch *Operation `json:"patch,omitempty"`
Query *Operation `json:"query,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
It marshals via reflection, so no MarshalJSON/UnmarshalJSON/JSONLookup changes are needed — just adding pathItem.Query to the ops slice in expandPathItem (expander.go). ~6 lines including a test. Happy to open a PR.
Describe alternatives you've considered
- Vendor extension (
x-query) — non-standard, not a real query key.
- Post-processing the marshaled JSON downstream — fragile and duplicated across every consumer.
Additional context
QUERY is a safe, idempotent, cacheable method that carries a body (semantics per RFC 9110), and is a valid Path Item operation in OpenAPI 3.2. I recognize this repo targets Swagger 2.0, where query isn't formally defined — open to guidance if you'd prefer a different home for it.
Is your feature request related to a problem? Please describe.
The HTTP
QUERYmethod (RFC 10008) has no representation inspec.PathItemPropsonly hasget/put/post/delete/options/head/patch, so a QUERY endpoint can't be documented or round-tripped. This blocks downstream tooling (swaggo/swag#2193).Describe the solution you'd like
Add a
Queryfield toPathItemProps:It marshals via reflection, so no
MarshalJSON/UnmarshalJSON/JSONLookupchanges are needed — just addingpathItem.Queryto theopsslice inexpandPathItem(expander.go). ~6 lines including a test. Happy to open a PR.Describe alternatives you've considered
x-query) — non-standard, not a realquerykey.Additional context
QUERYis a safe, idempotent, cacheable method that carries a body (semantics per RFC 9110), and is a valid Path Item operation in OpenAPI 3.2. I recognize this repo targets Swagger 2.0, wherequeryisn't formally defined — open to guidance if you'd prefer a different home for it.