Skip to content

Commit 6b2f0fa

Browse files
committed
docs(#32): document TS-only filter extensions (not the cross-port contract)
Resolves the #32 'decide' question: search / filter[or]|[and] / leading-wildcard / nesting-cap are TS-only-by-design (deferred until demand; none touch the metamodel vocabulary, so any can be added cross-port later additively). Fixes the doc's prior over-claim that filter[or]/[and] was part of the contract. Flags the in-list size cap (TS-only 100) as a safety/consistency divergence worth unifying regardless of demand. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GF9xLEQZaPus5Y6opk398n
1 parent 1c47737 commit 6b2f0fa

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

docs/features/api-contract.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ path segment without hand-coordination.
7676

7777
Filters use a **bracketed qs** shape: `filter[<field>][<op>]=<value>`.
7878
A bare value (`filter[<field>]=<value>`) is sugar for `eq`. Multiple
79-
filters AND together; the optional `filter[or]=[...]` / `filter[and]=[...]`
80-
keys nest disjunctions / conjunctions.
79+
filters AND together.
80+
81+
> **`filter[or]` / `filter[and]` nesting is a TS-only extension**, not part of
82+
> the cross-port contract — see "TS-only filter extensions" below.
8183
8284
| Operator | Strings | Numbers / Dates | Booleans |
8385
|---|---|---|---|
@@ -91,6 +93,27 @@ subtype doesn't support → HTTP 400. The operator list is a Tier 1
9193
cross-port invariant — every port's parser must implement these eight
9294
and only these eight.
9395

96+
### TS-only filter extensions (not part of the cross-port contract)
97+
98+
The TypeScript runtime parser ships five filter behaviors beyond the eight
99+
operators. They are **NOT part of the cross-port REST contract** — the other
100+
ports (Java, Kotlin, Python, C#) do not implement them, and a relying adopter
101+
must not assume them on a non-TS backend. They are deliberately deferred until
102+
real consumer demand (none touch the metamodel vocabulary, so any of them can be
103+
added cross-port later as a purely additive, non-breaking change):
104+
105+
| Extension | What it does |
106+
|---|---|
107+
| `?search=<term>` | ORs a `like` across the entity's `@filterable` string fields |
108+
| `filter[or][N]` / `filter[and][N]` | boolean combinators (recursive nesting) |
109+
| leading-wildcard gating | opt-in allow of `like` patterns starting with `%` |
110+
| filter nesting-depth cap | rejects deeply-nested `or`/`and` (tied to the combinators) |
111+
112+
The **`in`-list size cap** (reject an `in` list longer than 100 → HTTP 400) is a
113+
safety limit, not a feature — TS enforces it, the other ports currently do not.
114+
Unifying that cap cross-port is the one item here worth doing regardless of
115+
feature demand (it is a consistency/safety divergence, not a capability).
116+
94117
### Sort + pagination
95118

96119
- `sort=<field>:asc|desc` — single sort key (multi-sort not in the

0 commit comments

Comments
 (0)