What is the correct response format for apply the patch?
hulygun opened this issue · comments
Denis Tormazov commented
I have config:
{
"templates": {
"main": {
"type": "container",
"height": {
"type": "match_parent"
},
"visibility_action": {
"log_id": "load_data",
"url": "div-action://download?url=http://example.com/patch",
"visibility_duration": 1,
"visibility_percentage": 1
}
}
},
"card": {
"log_id": "card",
"states": [
{
"div": {
"type": "main",
"id": "main",
"items": [
{
"type": "text",
"id": "wellcome",
"text": "wellcome"
}
]
},
"state_id": 0
}
]
}
}
{
"changes": [
{
"id": "main",
"items": [
{
"type": "text",
"id": "goodbye",
"text": "goodbye"
}
]
}
]
}
In the logs I see that a request for a patch occurs but is not applied. Testing in DivKit Playground demo android
4eb0da commented
Hello! You need a templates field in the patch, even if it is empty
Denis Tormazov commented
That?
{
"patch": {
"changes": [...],
"mode": "partial"
},
"templates": {}
}
In this form, throws out of the screen. Please get correct structure.
4eb0da commented
Please make sure that all json in the changes
property uses only templates from the patch and not from the main card