From 2e72da2343d69d42417f095486ccd99b686597b9 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Mon, 6 Jul 2020 13:14:06 +0100 Subject: [PATCH] Fix spec bug concerning the type of a push rule's array of actions Signed-off-by: Olivier Wilkinson (reivilibre) --- api/client-server/pushrules.yaml | 26 ++++++++++++------- .../newsfragments/2669.clarification | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 changelogs/client_server/newsfragments/2669.clarification diff --git a/api/client-server/pushrules.yaml b/api/client-server/pushrules.yaml index 32c3c9a1..47580f3a 100644 --- a/api/client-server/pushrules.yaml +++ b/api/client-server/pushrules.yaml @@ -412,9 +412,9 @@ paths: description: |- The action(s) to perform when the conditions for this rule are met. items: - type: string - enum: ["notify", "dont_notify", "coalesce", "set_tweak"] - # TODO: type: object e.g. {"set_sound":"beeroclock.wav"} :/ + type: + - string + - object conditions: type: array description: |- @@ -592,7 +592,10 @@ paths: description: The actions for this push rule. examples: application/json: { - "actions": ["notify"] + "actions": [ + "notify", + {"set_tweak": "sound", "value": "bing"} + ] } schema: type: object @@ -601,7 +604,9 @@ paths: type: array description: The action(s) to perform for this rule. items: - type: string + type: + - string + - object required: ["actions"] tags: - Push notifications @@ -648,12 +653,15 @@ paths: type: array description: The action(s) to perform for this rule. items: - type: string - enum: ["notify", "dont_notify", "coalesce", "set_tweak"] - # TODO: type: object e.g. {"set_sound":"beeroclock.wav"} :/ + type: + - string + - object required: ["actions"] example: { - "actions": ["notify"] + "actions": [ + "notify", + {"set_tweak": "highlight"} + ] } responses: 200: diff --git a/changelogs/client_server/newsfragments/2669.clarification b/changelogs/client_server/newsfragments/2669.clarification new file mode 100644 index 00000000..0e219bfc --- /dev/null +++ b/changelogs/client_server/newsfragments/2669.clarification @@ -0,0 +1 @@ +Fix types of push rules' actions; they can be objects as well as strings.