Skip to content

Add QUERY Support For application/jsonpath #105

Description

@eviltester

Add QUERY Support For application/jsonpath

I want to send a QUERY request with a JSONPath expression body,
so that I can safely filter todo resources using a standards-based query language.

Scope

Implement QUERY /todos with:

Content-Type: application/jsonpath
Accept: application/json

The request body should be a JSONPath expression evaluated against the JSON todo collection.

Example:

QUERY /todos HTTP/1.1
Content-Type: application/jsonpath
Accept: application/json

$.todos[?@.doneStatus == false]

Expected Behaviour

  • QUERY /todos is safe and idempotent.
  • It must not create, update, or delete todos.
  • The body is parsed as a JSONPath expression.
  • The expression is evaluated against the same logical data returned by GET /todos.
  • The response returns matching todo items.
  • Response format is still controlled by the Accept header.
  • Accept-Query should advertise support:
Accept-Query: application/jsonpath

Error Behaviour

  • Missing Content-Type returns 400.
  • Unsupported Content-Type returns 415.
  • Invalid JSONPath syntax returns 400.
  • Valid JSONPath that cannot be applied safely returns 422.
  • Unsupported response Accept values still return 406.

Acceptance Criteria

  • QUERY /todos with application/jsonpath can filter by doneStatus.
  • It can filter by id, title, and description where JSONPath supports it.
  • It returns the same todo representation shape as GET /todos.
  • Repeating the same request returns the same result unless the todo data changes externally.
  • OPTIONS /todos includes QUERY in Allow.
  • HEAD /todos or OPTIONS /todos includes Accept-Query: application/jsonpath.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions