Fix spec bug concerning the type of a push rule's array of actions

Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
rei/bug_type_actions
Olivier Wilkinson (reivilibre) 4 years ago
parent f8ff2ad6a9
commit 2e72da2343

@ -412,9 +412,9 @@ paths:
description: |- description: |-
The action(s) to perform when the conditions for this rule are met. The action(s) to perform when the conditions for this rule are met.
items: items:
type: string type:
enum: ["notify", "dont_notify", "coalesce", "set_tweak"] - string
# TODO: type: object e.g. {"set_sound":"beeroclock.wav"} :/ - object
conditions: conditions:
type: array type: array
description: |- description: |-
@ -592,7 +592,10 @@ paths:
description: The actions for this push rule. description: The actions for this push rule.
examples: examples:
application/json: { application/json: {
"actions": ["notify"] "actions": [
"notify",
{"set_tweak": "sound", "value": "bing"}
]
} }
schema: schema:
type: object type: object
@ -601,7 +604,9 @@ paths:
type: array type: array
description: The action(s) to perform for this rule. description: The action(s) to perform for this rule.
items: items:
type: string type:
- string
- object
required: ["actions"] required: ["actions"]
tags: tags:
- Push notifications - Push notifications
@ -648,12 +653,15 @@ paths:
type: array type: array
description: The action(s) to perform for this rule. description: The action(s) to perform for this rule.
items: items:
type: string type:
enum: ["notify", "dont_notify", "coalesce", "set_tweak"] - string
# TODO: type: object e.g. {"set_sound":"beeroclock.wav"} :/ - object
required: ["actions"] required: ["actions"]
example: { example: {
"actions": ["notify"] "actions": [
"notify",
{"set_tweak": "highlight"}
]
} }
responses: responses:
200: 200:

@ -0,0 +1 @@
Fix types of push rules' actions; they can be objects as well as strings.
Loading…
Cancel
Save