Skip to content

Add First-Class Support for the HTTP QUERY Method (RFC 10008) #1345

Description

@otaviojava

This proposal introduces first-class support for the HTTP QUERY method, as defined by RFC 10008, into Jakarta REST.

Server API

This would be based on a single annotation:

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod("QUERY")
public @interface QUERY {
}

Usage:

@Path("/users")
public class UserResource {

    @QUERY
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public List<User> search(UserFilter filter) {
        return service.search(filter);
    }
}

Client API

Provide convenience methods for invoking QUERY requests without requiring generic method invocation.

Example:

client.target(uri)
      .request()
      .query(Entity.json(filter));

or equivalent API design determined by the specification committee.

Specification Goal

Define the semantics of QUERY according to RFC 10008:

  • Safe
  • Idempotent
  • Allows request content
  • Intended for retrieval and query operations
  • Not intended for resource modification

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions