Skip to content

Add support for RFC 10008 (The HTTP QUERY Method) - #6861

Merged
minwoox merged 7 commits into
line:mainfrom
desiderantes:query-method
Aug 3, 2026
Merged

Add support for RFC 10008 (The HTTP QUERY Method)#6861
minwoox merged 7 commits into
line:mainfrom
desiderantes:query-method

Conversation

@desiderantes

@desiderantes desiderantes commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Motivation:

Implement Support for RFC 10008

Modifications:

  • Added HttpMethod.QUERY support in core method handling.
    • Added QUERY enum constant and RFC reference in HttpMethod.
    • Added QUERY to supported method parsing and lookup paths.
    • Added QUERY to the idempotent methods set.
  • Added Accept-Query header constant.
    • Added HttpHeaderNames.ACCEPT_QUERY.
  • Added query(String path) support in request builders.
    • Added method to RequestMethodSetters.
    • Implemented in AbstractHttpRequestBuilder and overridden in HttpRequestBuilder.
  • Added Java client API support for QUERY.
    • Added query(...) overloads in WebClient and BlockingWebClient.
    • Added fluent query(String path) in RestClient.
    • Propagated query(String path) in request preparation/decorator classes.
  • Added HTTP/1 request encoding support for QUERY.
    • Updated ClientHttp1ObjectEncoder so QUERY follows the same zero-length body handling path as POST/PUT/PATCH.
  • Added server-side dispatch and annotation support for QUERY.
    • Added QUERY dispatch and doQuery(...) hook in AbstractHttpService.
    • Added new @Query annotation (core/.../server/annotation/Query.java).
    • Registered @Query -> HttpMethod.QUERY in AnnotatedServiceFactory.
    • Added annotation processor support in DocumentationProcessor.
  • Added GraalVM native-image reflection metadata for @Query.
    • Added com.linecorp.armeria.server.annotation.Query entry in reflect-config.json.
  • Added test coverage for new behavior.
    • Added tests for HttpMethod.QUERY parse/support/idempotency.
    • Added tests for HttpHeaderNames.ACCEPT_QUERY.
    • Added annotated service tests validating @Query routing and handling.
    • Added Scala suite updates validating @Query use in annotated endpoints.
  • Added Scala fluent API parity.
    • Added query(pathPattern) in ScalaRestClient.

Result:

  • Users can issue QUERY requests through Java and Scala high-level clients.
  • Servers can handle QUERY via both AbstractHttpService#doQuery(...) and @Query annotated methods.
  • Accept-Query header usage is now exposed as a standard constant.
  • Native-image users get reflection support for the new @Query annotation.

This is part of an ongoing effort of yours truly to enable QUERY method usage across the JVM ecosystem.

@CLAassistant

CLAassistant commented Jul 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds HTTP QUERY support across common HTTP types, Java and Scala client APIs, annotated server routing, reflection and annotation processing, HTTP/1 encoding, and automated tests. It also updates the Netty version catalog.

Changes

HTTP QUERY method support

Layer / File(s) Summary
HTTP QUERY contracts and request construction
core/src/main/java/com/linecorp/armeria/common/*, core/src/main/java/com/linecorp/armeria/client/ClientHttp1ObjectEncoder.java
Adds HttpMethod.QUERY, Accept-Query, fluent request builders, parsing and idempotency support, and zero-length HTTP/1 request encoding.
Annotated QUERY service routing
core/src/main/java/com/linecorp/armeria/server/annotation/Query.java, core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceFactory.java, core/src/main/java/com/linecorp/armeria/server/AbstractHttpService.java, annotation-processor/..., core/src/main/resources/META-INF/native-image/...
Adds the runtime @Query annotation, maps it to HttpMethod.QUERY, dispatches QUERY requests, and registers reflection and processor support.
Java and Scala client QUERY APIs
core/src/main/java/com/linecorp/armeria/client/*, scala/scala_2.13/...
Adds QUERY overloads for web and blocking clients, REST preparation, request bodies, query parameters, fluent delegation, and the Scala REST builder.
QUERY behavior validation
core/src/test/java/com/linecorp/armeria/..., scala/scala_2.13/...
Tests method parsing, header canonicalization, HTTP/1 body handling, annotated QUERY endpoints, Scala REST annotations, and OPTIONS method reporting.

Netty version update

Layer / File(s) Summary
Netty version catalog update
dependencies.toml
Updates the Netty version from 4.2.15.Final to 4.2.16.Final.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant WebClient
  participant HttpServer
  participant AnnotatedServiceFactory
  participant QueryHandler
  Client->>WebClient: send QUERY request
  WebClient->>HttpServer: execute QUERY with path and body
  HttpServer->>AnnotatedServiceFactory: resolve QUERY route
  AnnotatedServiceFactory->>QueryHandler: invoke `@Query` handler
  QueryHandler-->>Client: return QUERY response
Loading

Suggested reviewers: ikhoon, trustin, minwoox

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding support for the HTTP QUERY method defined by RFC 10008.
Description check ✅ Passed The description directly explains the QUERY method implementation across core APIs, clients, servers, annotations, metadata, and tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/src/main/java/com/linecorp/armeria/client/WebClient.java`:
- Around line 603-671: Mark all eight new query(...) overloads in
core/src/main/java/com/linecorp/armeria/client/WebClient.java:603-671 with
`@UnstableApi` and retain or add complete Javadoc. Also mark query(String path)
with `@UnstableApi` and add Javadoc in
core/src/main/java/com/linecorp/armeria/common/AbstractHttpRequestBuilder.java:78-82,
core/src/main/java/com/linecorp/armeria/common/HttpRequestBuilder.java:67-71,
and
core/src/main/java/com/linecorp/armeria/client/WebClientRequestPreparation.java:455-459.

In `@core/src/main/java/com/linecorp/armeria/server/annotation/Query.java`:
- Around line 31-33: Add the existing `@UnstableApi` annotation to the public
Query annotation declaration, including the required import, while preserving
its current retention and target metadata.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 66c09182-7cd5-494e-b561-b141bc7483d0

📥 Commits

Reviewing files that changed from the base of the PR and between a953182 and c912f5f.

📒 Files selected for processing (24)
  • annotation-processor/src/main/java/com/linecorp/armeria/server/annotation/processor/DocumentationProcessor.java
  • core/src/main/java/com/linecorp/armeria/client/BlockingWebClient.java
  • core/src/main/java/com/linecorp/armeria/client/BlockingWebClientRequestPreparation.java
  • core/src/main/java/com/linecorp/armeria/client/ClientHttp1ObjectEncoder.java
  • core/src/main/java/com/linecorp/armeria/client/FutureTransformingRequestPreparation.java
  • core/src/main/java/com/linecorp/armeria/client/RestClient.java
  • core/src/main/java/com/linecorp/armeria/client/TransformingRequestPreparation.java
  • core/src/main/java/com/linecorp/armeria/client/WebClient.java
  • core/src/main/java/com/linecorp/armeria/client/WebClientRequestPreparation.java
  • core/src/main/java/com/linecorp/armeria/common/AbstractHttpRequestBuilder.java
  • core/src/main/java/com/linecorp/armeria/common/HttpHeaderNames.java
  • core/src/main/java/com/linecorp/armeria/common/HttpMethod.java
  • core/src/main/java/com/linecorp/armeria/common/HttpRequestBuilder.java
  • core/src/main/java/com/linecorp/armeria/common/RequestMethodSetters.java
  • core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceFactory.java
  • core/src/main/java/com/linecorp/armeria/server/AbstractHttpService.java
  • core/src/main/java/com/linecorp/armeria/server/annotation/Query.java
  • core/src/main/resources/META-INF/native-image/com.linecorp.armeria/armeria/reflect-config.json
  • core/src/test/java/com/linecorp/armeria/common/HttpHeaderNamesTest.java
  • core/src/test/java/com/linecorp/armeria/common/HttpMethodTest.java
  • core/src/test/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceFactoryTest.java
  • core/src/test/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceTest.java
  • scala/scala_2.13/src/main/scala/com/linecorp/armeria/client/scala/ScalaRestClient.scala
  • scala/scala_2.13/src/test/scala/com/linecorp/armeria/client/scala/RestClientSuite.scala

Comment thread core/src/main/java/com/linecorp/armeria/client/WebClient.java
@jrhee17 jrhee17 added this to the 1.41.0 milestone Jul 20, 2026

@jrhee17 jrhee17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changes look good overall - I do think it's worth adding a test case for the WebClient <-> server simple case.
I guess we would need to bump the netty version to 4.2.16.Final do this:

netty = "4.2.15.Final"

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.27907% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.12%. Comparing base (8150425) to head (4a2b681).
⚠️ Report is 551 commits behind head on main.

Files with missing lines Patch % Lines
...com/linecorp/armeria/client/BlockingWebClient.java 0.00% 12 Missing ⚠️
...in/java/com/linecorp/armeria/client/WebClient.java 0.00% 12 Missing ⚠️
...ia/client/BlockingWebClientRequestPreparation.java 0.00% 2 Missing ⚠️
...a/client/FutureTransformingRequestPreparation.java 0.00% 2 Missing ⚠️
...armeria/client/TransformingRequestPreparation.java 0.00% 2 Missing ⚠️
...n/java/com/linecorp/armeria/client/RestClient.java 0.00% 1 Missing ⚠️
...rp/armeria/client/WebClientRequestPreparation.java 0.00% 1 Missing ⚠️
...orp/armeria/common/AbstractHttpRequestBuilder.java 0.00% 1 Missing ⚠️
...om/linecorp/armeria/common/HttpRequestBuilder.java 0.00% 1 Missing ⚠️
...m/linecorp/armeria/server/AbstractHttpService.java 50.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6861      +/-   ##
============================================
+ Coverage     74.46%   75.12%   +0.66%     
- Complexity    22234    25419    +3185     
============================================
  Files          1963     2265     +302     
  Lines         82437    94389   +11952     
  Branches      10764    12340    +1576     
============================================
+ Hits          61385    70912    +9527     
- Misses        15918    17620    +1702     
- Partials       5134     5857     +723     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jrhee17 jrhee17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look reasonable to me 👍

Comment thread dependencies.toml

@ikhoon ikhoon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@minwoox minwoox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread core/src/test/java/com/linecorp/armeria/client/HttpClientIntegrationTest.java Outdated
Comment thread core/src/test/java/com/linecorp/armeria/client/HttpClientIntegrationTest.java Outdated
Comment thread core/src/test/java/com/linecorp/armeria/client/HttpClientIntegrationTest.java Outdated
@minwoox
minwoox merged commit 758ae57 into line:main Aug 3, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants