Skip to content

[finding] schema-design.mdx's apiMethods sample says "six primitives only" and lists five — copying it silently denies bulk #10590

Description

@os-elon

Found by the docs audit of the first-run path (#10563).

What is wrong

content/docs/data-modeling/schema-design.mdx:71-77 says "six primitives only" and
then enumerates five:

enable: {
...
apiMethods: [// Whitelist API operations — six primitives only;'get',// search/export/… DERIVE from them (list grants'list',// aggregate/search/export; create+update grants'create',// upsert/import). undefined = all, [] = none.'update','delete'],

bulk is missing. packages/spec/src/data/object.zod.ts:18-22:

exportconstApiMethod=z.enum(['get','list',// Read'create','update','delete',// Write'bulk',// Batch operations]);

An apiMethods whitelist is exact — undefined = unrestricted, a subset = that
subset's derived closure — so a reader who copies this sample silently denies
batch operations
on the object while believing they enumerated everything. The
comment asserting "six" next to a list of five is what makes it a trap rather than
an abbreviation.

The sibling page has it right: content/docs/data-modeling/objects.mdx:96
"Whitelist over the six primitives (get/list/create/update/delete/bulk)".

Back-link: #10563

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions