Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion specification/v1_0/json/renderer_to_agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,22 @@
"description": "Unique ID for this action call. Only needed if wantResponse is true."
}
},
"required": ["name", "surfaceId", "sourceComponentId", "timestamp", "context"]
"required": ["name", "surfaceId", "sourceComponentId", "timestamp", "context"],
"allOf": [
{
"if": {
"properties": {
"wantResponse": {
"const": true
}
},
"required": ["wantResponse"]
},
"then": {
"required": ["actionId"]
}
}
]
},
"functionResponse": {
"properties": {
Expand Down
52 changes: 52 additions & 0 deletions specification/v1_0/test/cases/renderer_messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,58 @@
}
}
},
{
"description": "Valid action requesting a response with an actionId",
"valid": true,
"data": {
"version": "v1.0",
"action": {
"name": "submit",
"surfaceId": "main",
"sourceComponentId": "btn_submit",
"timestamp": "2023-10-27T10:00:00Z",
"context": {
"foo": "bar"
},
"wantResponse": true,
"actionId": "submit-1"
}
}
},
{
"description": "Invalid action requesting a response without an actionId",
"valid": false,
"data": {
"version": "v1.0",
"action": {
"name": "submit",
"surfaceId": "main",
"sourceComponentId": "btn_submit",
"timestamp": "2023-10-27T10:00:00Z",
"context": {
"foo": "bar"
},
"wantResponse": true
}
}
},
{
"description": "Valid action not requesting a response without an actionId",
"valid": true,
"data": {
"version": "v1.0",
"action": {
"name": "submit",
"surfaceId": "main",
"sourceComponentId": "btn_submit",
"timestamp": "2023-10-27T10:00:00Z",
"context": {
"foo": "bar"
},
"wantResponse": false
}
}
},
{
"description": "Valid error message (validation failed)",
"valid": true,
Expand Down
Loading