Skip to content

Commit 1821443

Browse files
committed
test(rest,runtime): a blank projection member is refused at its own index
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgm45oXexLiY5mMigQ
1 parent 96f9915 commit 1821443

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎packages/rest/src/data-empty-projection-count-door.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ const REFUSED_POST: ReadonlyArray<readonly [string, Record<string, unknown>, str
6666
* [#26909] The body's published schema (`FindDataRequestSchema`) now declares
6767
* the projection the normalizer enforces, so these are refused where every
6868
* other malformed body is: at the schema, `400 VALIDATION_FAILED`, `fields[0]`
69-
* naming `query.<key>` (the #25269 precedent for the page window).
69+
* naming `query.<key>`, and the member for a blank name (the #25269 precedent
70+
* for the page window).
7071
*/
7172
const REFUSED_POST_AT_SCHEMA: ReadonlyArray<readonly [string, Record<string, unknown>, string]> = [
7273
['select: ""', { select: '' }, 'query.select'],
7374
['$select: ","', { $select: ',' }, 'query.$select'],
7475
['select: []', { select: [] }, 'query.select'],
75-
['select: ["label", ""]', { select: ['label', ''] }, 'query.select'],
76+
['select: ["label", ""] (the blank member)', { select: ['label', ''] }, 'query.select.1'],
7677
];
7778

7879
function createMockServer() {

‎packages/runtime/src/domains/data-empty-projection-count.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,14 @@ describe('[#26644] the dispatcher /data doors — an empty projection and an unr
129129
// [#26909] The body's published schema (`FindDataRequestSchema`) now
130130
// declares the projection the normalizer enforces, so `select` / `$select`
131131
// naming no field is refused where every other malformed body is: at the
132-
// schema, `400 VALIDATION_FAILED` naming `query.<key>` (the #25269
133-
// precedent for the page window). Still a 400, still before any read.
132+
// schema, `400 VALIDATION_FAILED` naming `query.<key>`, and the member for
133+
// a blank name (the #25269 precedent for the page window). Still a 400,
134+
// still before any read.
134135
it.each<[string, Record<string, unknown>, string]>([
135136
['{"select":""}', { select: '' }, 'query.select'],
136137
['{"$select":","}', { $select: ',' }, 'query.$select'],
137138
['{"select":[]}', { select: [] }, 'query.select'],
138-
['{"select":["name",""]}', { select: ['name', ''] }, 'query.select'],
139+
['{"select":["name",""]} (the blank member)', { select: ['name', ''] }, 'query.select.1'],
139140
])('POST query %s: 400 VALIDATION_FAILED naming the body key at the schema — no read', async (_name, body, field) => {
140141
const before = reads.n;
141142

0 commit comments

Comments
 (0)