From 554e635a6c6c3df794a370c69de0d00c9df91026 Mon Sep 17 00:00:00 2001 From: "Ethan (Taehoon) Lee" <48551278+thdxg@users.noreply.github.com> Date: Sun, 12 Jul 2026 00:46:55 +0900 Subject: [PATCH] feat: add QUERY method to PathItemProps The HTTP QUERY method (RFC 10008) is a safe, idempotent, cacheable method that carries a request body, and is a valid Path Item operation in OpenAPI 3.2. Add a Query field to PathItemProps so QUERY endpoints can be represented and round-tripped, and include it in the operation walk during $ref expansion. Fixes #287 Signed-off-by: Ethan (Taehoon) Lee <48551278+thdxg@users.noreply.github.com> --- expander.go | 1 + path_item.go | 1 + path_item_test.go | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/expander.go b/expander.go index f9c2fa3..d6c90a9 100644 --- a/expander.go +++ b/expander.go @@ -404,6 +404,7 @@ func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) pathItem.Post, pathItem.Patch, pathItem.Delete, + pathItem.Query, } for _, op := range ops { if err := expandOperation(op, resolver, basePath); resolver.shouldStopOnError(err) { diff --git a/path_item.go b/path_item.go index 4408ece..c2fb243 100644 --- a/path_item.go +++ b/path_item.go @@ -19,6 +19,7 @@ type PathItemProps struct { Options *Operation `json:"options,omitempty"` Head *Operation `json:"head,omitempty"` Patch *Operation `json:"patch,omitempty"` + Query *Operation `json:"query,omitempty"` Parameters []Parameter `json:"parameters,omitempty"` } diff --git a/path_item_test.go b/path_item_test.go index 8a08f6a..dc44123 100644 --- a/path_item_test.go +++ b/path_item_test.go @@ -38,6 +38,9 @@ var pathItem = PathItem{ //nolint:gochecknoglobals // test fixture Patch: &Operation{ OperationProps: OperationProps{Description: "patch operation description"}, }, + Query: &Operation{ + OperationProps: OperationProps{Description: "query operation description"}, + }, Parameters: []Parameter{ { ParamProps: ParamProps{In: "path"}, @@ -56,6 +59,7 @@ const pathItemJSON = `{ "options": { "description": "options operation description" }, "head": { "description": "head operation description" }, "patch": { "description": "patch operation description" }, + "query": { "description": "query operation description" }, "parameters": [{"in":"path"}] }`