ErrorsReads and writes · rule
data.patch_field_required
Patch input has a field that isn't optional.
Area 6, Reads and writes; not declinable; the next step is usually the agent's.
type ItemName = Text { max_length: 80}entity Item { id: Uuid name: ItemName}type ItemChanges = Input { pick: [Item.name]}action edit(item: Item, amendment: ItemChanges) -> Item { return Item.update(item) { patch: amendment }}
error ItemChanges.name isn't optional, so a patch can't leave it out
--> main.jadpo:16:16
|16 | patch: amendment | ^^^^^^^^^ `ItemChanges`
- reason
- A patch changes only the fields a request supplied, so each field of its input is optional: one left out keeps its value. A required
namewould have to be sent every time. - next
- Make
nameoptional inItemChanges(optional: true, oroptional: all), or set it withset:(agent) - rule
- data.
patch_ field_ required - help
- https://jadpo.
dev/docs/errors/data. patch_ field_ required
Markdown for agents: /docs/errors/data.patch_field_required.md.Built from Jadpo main at aee2e8f.