Error condition

malformed-query

The body does not conform to the grammar.

Type URI
https://openpredicate.tech/problems/malformed-query
HTTP status
400 Bad Request
Defined in
Specification §8

What it means

The filter is not well-formed OpenPredicate: an unknown operator, an operand of the wrong type, or a structural error such as an empty filter object or $and with a non-array value. This is the one condition a client can rule out entirely before sending the request, by validating against the schema.

What a client does about it

Validate the filter against the schema — in CI, in the client, or in the playground. Because the grammar is a JSON Schema, a generated client can be made unable to construct this error at all.

What a server should send

Report the offending clause with a pointer. A client facing a deeply nested filter cannot otherwise tell which clause to fix.

application/problem+json
{
  "type": "https://openpredicate.tech/problems/malformed-query",
  "title": "Malformed query",
  "status": 400,
  "detail": "'$matches' is not an operator in this grammar.",
  "pointer": "/filter/$and/0/name/$matches"
}

The wire format is the API's own. The specification mandates the condition, not this envelope: an API with an established error format should express the condition in it rather than carry a second format for one endpoint. The member names above are the recommended ones.

The other conditions