unreadableFilter.php
Table of Contents
Functions
- unreadableFilter() : RequestValidationException
- Builds the refusal answered to a request whose filter has a shape no filter reads : not a segment `{"key":…}`, not a group `["and"|"or"|"not", …]`.
Functions
unreadableFilter()
Builds the refusal answered to a request whose filter has a shape no filter reads : not a segment `{"key":…}`, not a group `["and"|"or"|"not", …]`.
unreadableFilter(mixed $filter) : RequestValidationException
Such a filter used to be dropped : no clause, no error, and the whole collection came
back in 200 — a Mongo-style {"age":{"$gte":30}}, a mistyped {"agee":1}, a filter
left as a JSON string, the {"logic":…,"conditions":[…]} form the documentation once
taught. Inside an and, the child vanished and loosened the group. The refusal names
what arrived — the type of a scalar, the keys of an object — and the two shapes that
would have been read.
Parameters
- $filter : mixed
-
The filter, or the member of a group, as the request sent it.
Tags
Return values
RequestValidationException —The 400 refusal, ready to be thrown.