Support the HTTP QUERY verb (RFC 10008) in Wolverine.HTTP#3296
Merged
Conversation
Adds [WolverineQuery("/route")] for the QUERY method — a safe, idempotent verb (like
GET) that additionally carries a request body, for search/query endpoints whose criteria
are too large or structured for the query string.
Almost all of Wolverine.Http's endpoint machinery is verb-agnostic, so QUERY works with a
single new attribute:
* Routing: the verb flows to ASP.NET Core as HttpMethodMetadata string(s); no allow-list.
* Request body: body binding is only skipped for "GET", so QUERY binds a body like POST.
* Transactions: exemption is dependency-based (outbox only when the handler depends on
IMessageBus/MessageContext), so a safe QUERY endpoint is never transactional — even
under AutoApplyTransactions — without any verb special-casing.
The one place that needed handling is OpenAPI: OpenAPI 3.1 (the Swashbuckle /
Microsoft.OpenApi stack Wolverine emits with) has no QUERY operation and Swashbuckle
throws mapping the method, which would break document generation for the whole app.
WolverineApiDescriptionProvider now gracefully omits QUERY endpoints from the API
description — matching ASP.NET Core's own OpenAPI 3.1 behavior. The endpoints stay fully
routable; first-class OpenAPI 3.2 documentation can follow once the stack supports it.
Tests: QUERY endpoint reads a request body, carries correct HttpMethodMetadata, is not
wrapped in transactional middleware, and does not break swagger generation. Docs added.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 9, 2026
Merged
This was referenced Jul 10, 2026
This was referenced Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
[WolverineQuery("/route")]for the HTTP QUERY method (RFC 10008, June 2026).What QUERY is
QUERY is a safe, idempotent method — like GET — that additionally carries a request body. It's the "GET with a body" for search/query endpoints whose criteria are too large or structured for the query string.
What changed
Wolverine.HTTP's endpoint machinery is almost entirely verb-agnostic, so QUERY needed just one new attribute plus one OpenAPI fix:
WolverineQueryAttribute : WolverineHttpMethodAttribute(base("QUERY", template)), discovered generically like every other verb. Uses the literal"QUERY"so it works on net9.0 and net10.0 alike (the net10-onlyHttpMethods.Queryisn't required).HttpMethodMetadata; there's no verb allow-list, so"QUERY"matches."GET"(JsonHandling.cs), so QUERY binds a body exactly like POST.HttpChain.RequiresOutbox()→ outbox only when the handler depends onIMessageBus/MessageContext). A safe QUERY endpoint is therefore never wrapped in transactional/outbox middleware — even underAutoApplyTransactions()— with no verb special-casing.Microsoft.OpenApistack emits) has no QUERY operation — Swashbuckle throws aKeyNotFoundExceptionmapping the method, which would break document generation for the whole app.WolverineApiDescriptionProvidernow gracefully omits QUERY endpoints from the API description, matching ASP.NET Core's own OpenAPI 3.1 behavior. Endpoints stay fully routable; first-class OpenAPI 3.2 documentation can follow once the stack supports it.Tests (
query_verb_support.cs)QUERYrequest through the test server'sHttpClient, since Alba's scenario helpers assume standard verbs).HttpMethodMetadata("QUERY").RequiresOutbox()false) even withAutoApplyTransactions()on.swagger.jsongeneration still succeeds with a QUERY endpoint present (QUERY gracefully omitted).Research notes
HttpMethods.Query/IsQueryand registers QUERY viaMapMethods, but deliberately cutMapQueryand[HttpQuery]in API review — so a[WolverineQuery]attribute is the natural Wolverine equivalent.x-oai-additionalOperationsfor 3.1). This PR targets parity with .NET 10 (graceful omission on 3.1).Docs: new "The HTTP QUERY Method" section in
guide/http/endpoints.md(usage + the transaction and OpenAPI notes). Follow-up AI-skill coverage tracked separately.🤖 Generated with Claude Code