-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I have 2 model Task and Hearts, Task embedsMany hearts.
task.json
{
"name": "Task",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"taskId": {
"type": "string"
}
},
"validations": [],
"relations": {
"hearts": {
"type": "embedsMany",
"model": "hearts",
"property": "heartsList",
"options": {
"validate": false,
"forceId": false
}
}
}},
"acls": [],
"methods": {}
}
hearts.json
{
"name": "hearts",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"hid": {
"type": "string"
}
},
"validations": [],
"relations": {
},
"acls": [],
"methods": {}
}
After model creation when i do a POST call.
Request:
POST http://localhost:3000/api/Tasks
Payload:
{
"taskId": "string"
}
Response:
{
"taskId": "string",
"id": 1,
"heartsList": []
}
Expected Result: Since I did not pass heartsList I do not expect it to be added in response, We have a situation where the heartsList property is readonly and should not be passed for POST Call.
Is there a way to omit it from getting added with default empty brackets?