diff --git a/.changeset/8735-objectql-mirror-docblocks-not-defaulted.md b/.changeset/8735-objectql-mirror-docblocks-not-defaulted.md new file mode 100644 index 0000000000..e2704861b1 --- /dev/null +++ b/.changeset/8735-objectql-mirror-docblocks-not-defaulted.md @@ -0,0 +1,14 @@ +--- +'@object-ui/types': patch +--- + +Correct four `zod/objectql.zod.ts` docblocks that described the behaviour objectui#8317 +removed. Since that change the zod mirrors strip imported `@objectstack/spec` defaults at +this package's import boundary, but the docblocks on `HttpRequestSchema`, `ListColumnSchema`, +`SelectionConfigSchema` and `PaginationConfigSchema` still said, in the present tense, that +`method`, `prefix.type`, `type` and `pageSize` are defaulted on parse — the opposite of what +each export does. Each now says the key is declared and accepted but NOT defaulted on parse. + +Comment-only: no default, no behaviour and no accept set moves. The corrected text is +published — it is emitted verbatim into `dist/zod/objectql.zod.d.ts`, which is why it earns +an entry rather than being an internal note. diff --git a/packages/types/src/zod/objectql.zod.ts b/packages/types/src/zod/objectql.zod.ts index 1cb8452d24..e92e66eb84 100644 --- a/packages/types/src/zod/objectql.zod.ts +++ b/packages/types/src/zod/objectql.zod.ts @@ -95,7 +95,9 @@ export const HttpMethodSchema = stripImportedDefaults(SpecHttpMethodSubsetSchema * HTTP Request Schema — `@objectstack/spec/ui` schema re-exported by reference * (issue #2231; formerly a hand-written mirror). Differences vs the old mirror: * `body` is the spec's `z.unknown()` (a superset of the old record/string/FormData/ - * Blob union) and `method` now defaults to `'GET'` on parse. + * Blob union). `method` is declared and accepted but NOT defaulted on parse: + * the spec's `.default('GET')` is stripped at the import boundary above, so a + * request that omits `method` comes back without it. */ export const HttpRequestSchema = stripImportedDefaults(SpecHttpRequestSchema); @@ -118,22 +120,27 @@ export const ViewDataSchema = stripImportedDefaults(SpecViewDataSchema); * and `prefix` is the spec's `ColumnPrefixSchema`. With both upstream the * extension collapses to the plain re-export it always said it would become. * - * One behavior change rides along: the spec's `prefix.type` defaults to `'text'` - * on parse instead of staying `undefined`, so the renderer always gets a value. + * The spec declares `prefix.type` with a `.default('text')`. That default is + * stripped at the import boundary above, so the key is declared and accepted but + * NOT defaulted on parse: a column omitting `prefix.type` comes back without it, + * and a renderer reading it cannot assume a value is present. */ export const ListColumnSchema = stripImportedDefaults(SpecListColumnSchema); /** * Selection Config Schema — `@objectstack/spec/ui` schema re-exported by reference - * (issue #2231; formerly a hand-written mirror). `type` now defaults to `'none'` - * on parse instead of staying undefined. + * (issue #2231; formerly a hand-written mirror). `type` is declared and accepted + * but NOT defaulted on parse: the spec's `.default('none')` is stripped at the + * import boundary above, so an omitted `type` stays omitted. */ export const SelectionConfigSchema = stripImportedDefaults(SpecSelectionConfigSchema); /** * Pagination Config Schema — `@objectstack/spec/ui` schema re-exported by reference - * (issue #2231; formerly a hand-written mirror). `pageSize` is now the spec's - * positive-int with a default of 25 on parse. + * (issue #2231; formerly a hand-written mirror). `pageSize` is the spec's + * positive-int, declared and accepted but NOT defaulted on parse: the spec's + * `.default(25)` is stripped at the import boundary above, so an omitted + * `pageSize` stays omitted. */ export const PaginationConfigSchema = stripImportedDefaults(SpecPaginationConfigSchema);