Skip to content

Commit adf9443

Browse files
authored
Merge pull request #2669 from matrix-org/rei/bug_type_actions
Fix spec bug concerning the type of a push rule's array of actions
2 parents 868ca45 + 2e72da2 commit adf9443

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

api/client-server/pushrules.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ paths:
412412
description: |-
413413
The action(s) to perform when the conditions for this rule are met.
414414
items:
415-
type: string
416-
enum: ["notify", "dont_notify", "coalesce", "set_tweak"]
417-
# TODO: type: object e.g. {"set_sound":"beeroclock.wav"} :/
415+
type:
416+
- string
417+
- object
418418
conditions:
419419
type: array
420420
description: |-
@@ -592,7 +592,10 @@ paths:
592592
description: The actions for this push rule.
593593
examples:
594594
application/json: {
595-
"actions": ["notify"]
595+
"actions": [
596+
"notify",
597+
{"set_tweak": "sound", "value": "bing"}
598+
]
596599
}
597600
schema:
598601
type: object
@@ -601,7 +604,9 @@ paths:
601604
type: array
602605
description: The action(s) to perform for this rule.
603606
items:
604-
type: string
607+
type:
608+
- string
609+
- object
605610
required: ["actions"]
606611
tags:
607612
- Push notifications
@@ -648,12 +653,15 @@ paths:
648653
type: array
649654
description: The action(s) to perform for this rule.
650655
items:
651-
type: string
652-
enum: ["notify", "dont_notify", "coalesce", "set_tweak"]
653-
# TODO: type: object e.g. {"set_sound":"beeroclock.wav"} :/
656+
type:
657+
- string
658+
- object
654659
required: ["actions"]
655660
example: {
656-
"actions": ["notify"]
661+
"actions": [
662+
"notify",
663+
{"set_tweak": "highlight"}
664+
]
657665
}
658666
responses:
659667
200:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix types of push rules' actions; they can be objects as well as strings.

0 commit comments

Comments
 (0)