CodamAIDocs
Topicdone

When a filter does not fit

What happens with a missing key, a wrong operator, a value that does not fit, an invalid UUID, an unknown field or an unresolvable mandatory filter.

Variants
key/param missing → 400invalid UUID → 400unknown field → 400operator does not fit the field → 400field of a subtype → allowedvalue does not fit the type → 400operator unknown → 400wrong sort field → 400parameter null → 400mandatory filter unresolvable → 500

What this is about

A filter CDMS cannot apply is never left out. The search would otherwise run without it and return more matches than you wanted. CDMS therefore has exactly two reactions:

Two reactions to a broken filter
rejected
400
  • CDMS detects the error in the request
  • messageKey names the cause, the field and often the value
  • the client has to correct the request
aborted
500
  • a security filter cannot be applied
  • unresolvable-mandatory-filter|…
  • caused by the configuration, not by the request

Not a broken filter, but refused as well: a filter or an order on a field whose read role you lack. That results in 403 missing-permission|<role>. See Protected values.

All cases at a glance

Broken filters and what CDMS makes of them
CaseExampleResponse
key missing{ "value": "x", "param": "EQ" }400 missing-search|key
param explicitly null{ "key": "label", "value": "x", "param": null }400 missing-search|param
param missing entirely{ "key": "label", "value": "x" }no error: LIKE is the default
invalid UUID with EQ or MEMBEROF{ "key": "id", "value": "no-uuid", "param": "EQ" }400 wrong-uuid-in-where|no-uuid
invalid UUID with NEQ or IN{ "key": "id", "value": "no-uuid", "param": "IN" }400 wrong-uuid-in-where|no-uuid
unknown field{ "key": "nope", "value": "x", "param": "EQ" }400 unknown-search-key|nope
unknown step in the path{ "key": "firma.companyname", … }400 unknown-search-key|firma.companyname
field only a subtype hascompany in a search on tenant/personallowed, matches rows of that subtype only
operator does not fit the field typelabel BEFORE, active AFTER400 unsupported-operator|label|BEFORE
unknown enum value with EQ/NEQtype EQ BOSS400 wrong-value-in-where|type|BOSS
boolean other than true/falseactive EQ yes400 wrong-value-in-where|active|yes
value missing on a text field{ "key": "label", "param": "EQ" }no matches, 200
value missing on another field{ "key": "dueOn", "param": "AFTER" }400 wrong-value-in-where|dueOn|null
value does not fit the typeamount EQ abc, dueOn EQ 10.02.2026400 wrong-value-in-where|amount|abc
unknown enum value with INtype IN CEO,BOSS400 wrong-value-in-where|type|BOSS
LIKE on a numberamount LIKE 1%400 like-needs-text|amount
operator unknown or in lower case"param": "eq", "param": "FOO"400 invalid-value|parameter.query.filter[0].param
MEMBEROF on a non-listlabel MEMBEROF x400 memberof-needs-collection|label
unknown sort field{ "field": "nope", "order": "ASC" }400 wrong-order-element-exception
sort direction in lower case"order": "desc"400 invalid-value|parameter.order[0].order
parameter explicitly null"parameter": null400 missing-parameter
mandatory filter not applicableattribute filter on a field that does not exist500 unresolvable-mandatory-filter|…
attribute for the attribute filter missing in the profileprofile without company422 missing-attribute-on-profile|company

How CDMS checks a filter

Three checks before a filter goes to the database
  1. 1
    CDMS
    looks up the field from key in the model, step by step along the path; for an abstract model also in its subtypes
  2. 2
    CDMS
    checks whether the operator fits the field type: AFTER and BEFORE exist for dates, times and numbers
  3. 3
    CDMS
    converts the value into the type of the field
  4. 4
    CDMS→Database
    runs the search with all filters
    Result: If a check fails, CDMS answers 400 and names the field, the operator or the value. The search does not run at all.

This holds in every mode, outside the strict mode as well. For the filters that always run along it is a 500: a security filter that cannot be applied is caused by the configuration, not by your request.

How to find the error

From symptom to cause

When: The search returns more than expected, maybe everything.

Does every group have a type? Without type the group is OR, see AND/OR groups. Is a filter in the wrong group? A typo in key is no longer the cause, it leads to 400.

Result: Usually a forgotten type.

When: The search returns nothing, although matching data exists.

LIKE without %? Spaces in an IN list? Is an alternative in an AND group instead of an OR group? Or the data is invisible to this person.

Result: Usually a missing % or a security filter.

When: Response with messageKey.

The messageKey names the cause, the field and the value, e.g. unknown-search-key|firma.companyname for a typo in the path, unsupported-operator|label|BEFORE, wrong-value-in-where|dueOn|10.02.2026 or invalid-value|parameter.query.filter[0].param for an operator in lower case.

Result: Correct the named key, operator or value. For date values, see Date and time values.

When: messageKey is unresolvable-mandatory-filter|….

A filter that always runs along cannot be applied, for example an attribute filter on a field that does not exist. This is caused by the configuration of the model, not by your request.

Result: Have the modeling checked, see Filters that always run along.

Sources in the code and the knowledge base
  • CDMS/cdms-persistence-database – DatabaseConditionBuilder, DatabaseOrderBuilder
  • CDMS/cdms-rest-api – CdmsExceptionMapper
  • Probe against cdms-integrationtest (preset, employee, company), 2026-09-21
  • CDMS/cdms-integrationtest – QueryInputError*, QueryFilterTypes*, HubQuery*
Search