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.
Add
QUERYSupport Forapplication/jsonpathI want to send a
QUERYrequest with a JSONPath expression body,so that I can safely filter todo resources using a standards-based query language.
Scope
Implement
QUERY /todoswith:The request body should be a JSONPath expression evaluated against the JSON todo collection.
Example:
Expected Behaviour
QUERY /todosis safe and idempotent.GET /todos.Acceptheader.Accept-Queryshould advertise support:Accept-Query: application/jsonpathError Behaviour
Content-Typereturns400.Content-Typereturns415.400.422.Acceptvalues still return406.Acceptance Criteria
QUERY /todoswithapplication/jsonpathcan filter bydoneStatus.id,title, anddescriptionwhere JSONPath supports it.GET /todos.OPTIONS /todosincludesQUERYinAllow.HEAD /todosorOPTIONS /todosincludesAccept-Query: application/jsonpath.