Field Submit (Option/File/XToOne)
The formats below apply to create/update APIs (createOne, createList, updateOne, updateList, and variants).
Option / MultiOption
Submit format:
Option(single): option item code string.MultiOption(multiple): option item code list (recommended), or comma-separated string.
Examples:
{
"status": "Active",
"tags": ["A", "B", "C"]
}Clear semantics:
Option: set field tonull(if field is not required).MultiOption: set to[], ornull(if field is not required).
File / MultiFile
Submit format:
File(single): uploadedfileId.MultiFile(multiple):fileIdlist.
Examples:
{
"avatar": "1001",
"attachments": ["2001", "2002", "2003"]
}Clear semantics:
File: set field tonull(if field is not required).MultiFile: set to[], ornull(if field is not required).
ManyToOne / OneToOne
Submit format:
- Submit related row id directly.
- Do not submit a nested object (
{id, displayName}) as input value.
Examples:
{
"deptId": "3001",
"ownerId": "4001"
}Clear semantics:
- Set field to
null(if field is not required) to unlink relation.
Validation notes:
- Related ids are formatted according to the related model id type before persistence.
- If the field is required, setting
nullwill be rejected.
XToMany API Submit
OneToMany and ManyToMany fields support both full submit and incremental patch submit in create/update APIs
(createOne, createList, updateOne, updateList, and *AndFetch variants).
The backend distinguishes mode by field value type:
List-> full submit mode (existing behavior, backend infers add/update/delete by diff)Object(Map)-> patch submit mode (execute operations by patch keys directly)
In the frontend ModelForm component, XToMany fields support pagination, so patch submit is used by default; the operation type is indicated by PatchType in the submitted payload.
PatchType Options:
- OneToMany fields:
Create、Update、Delete; - ManyToMany fields:
Add、Remove;
OneToMany Submit
Field value supports:
- Full submit:
[{row1}, {row2}]. If the field value is[]in update API,, clear the history record. - Patch submit,
PatchTypeas the key:
{
"Create": [{ "name": "new row" }],
"Update": [{ "id": 101, "name": "changed" }],
"Delete": [102, 103]
}Rules:
Create/Updatevalues must be row list (List<Map>or object list convertible to map).Deletevalue must be id list.- In create main model data scene, only
Createis allowed;UpdateandDeleteare rejected. - In update main model data scene,
Update/Deleteids must belong to the current parent row.
ManyToMany Submit
Field value supports:
- Full submit:
[id1, id2, id3]. If the field value is[]in update API, clear the history record. - Patch submit,
PatchTypeas the key:
{
"Add": [1, 2, 3],
"Remove": [4, 5]
}Rules:
AddandRemovevalues must be id list (or object list with readableidfield).- In create main model data scene, only
Addis allowed;Removeis rejected. - In update main model data scene:
Addadds only non-existing relationships.Removedeletes only existing relationships.
Compatibility and Validation
- Full submit mode remains compatible with existing infer logic.
- Patch keys are case-insensitive and support both enum-style and display-style names:
- OneToMany:
CREATE/UPDATE/DELETEorCreate/Update/Delete - ManyToMany:
ADD/REMOVEorAdd/Remove
- OneToMany:
- Unknown patch key or non-list patch value will fail fast with parameter validation error.
Last updated on