Skip to content

Support the HTTP QUERY method (RFC 10008) on PathItemProps #288

Description

@thdxg

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions