immutable properties complete and tested
This commit is contained in:
@ -873,5 +873,77 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "immutable property validation in request vs response context",
|
||||
"database": {
|
||||
"types": [
|
||||
{
|
||||
"name": "item",
|
||||
"schemas": {
|
||||
"save_item.request": {
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"immutable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"get_item.response": {
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"immutable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "immutable property in request context causes IMMUTABLE_PROPERTY_VIOLATION",
|
||||
"data": {
|
||||
"id": "123",
|
||||
"created_at": "2026-07-21T00:00:00Z"
|
||||
},
|
||||
"schema_id": "save_item.request",
|
||||
"action": "validate",
|
||||
"expect": {
|
||||
"success": false,
|
||||
"errors": [
|
||||
{
|
||||
"code": "IMMUTABLE_PROPERTY_VIOLATION",
|
||||
"values": {
|
||||
"property_name": "created_at"
|
||||
},
|
||||
"details": {
|
||||
"path": "created_at",
|
||||
"schema": "save_item.request"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "immutable property in response context is allowed",
|
||||
"data": {
|
||||
"id": "123",
|
||||
"created_at": "2026-07-21T00:00:00Z"
|
||||
},
|
||||
"schema_id": "get_item.response",
|
||||
"action": "validate",
|
||||
"expect": {
|
||||
"success": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user