mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-30 12:38:38 +01:00
Give valid swagger. Split out rule/ruleset to separate definitions.
This commit is contained in:
parent
db25276856
commit
f6da9d7760
20
api/client-server/v1/definitions/push_rule.json
Normal file
20
api/client-server/v1/definitions/push_rule.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"rule_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"actions": {
|
||||
"items": {
|
||||
"type": ["object", "string"]
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
type: "object"
|
||||
properties:
|
||||
rule_id:
|
||||
type: string
|
||||
actions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
default:
|
||||
type: boolean
|
||||
enabled:
|
||||
type: boolean
|
||||
60
api/client-server/v1/definitions/push_ruleset.json
Normal file
60
api/client-server/v1/definitions/push_ruleset.json
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"content": {
|
||||
"items": {
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "push_rule.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"override": {
|
||||
"items": {
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "push_rule.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"sender": {
|
||||
"items": {
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "push_rule.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"underride": {
|
||||
"items": {
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "push_rule.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"room": {
|
||||
"items": {
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "push_rule.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
type: "object"
|
||||
properties:
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
allOf: [ "$ref": "definitions/push_rule.yaml"]
|
||||
override:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
allOf: [ "$ref": "definitions/push_rule.yaml"]
|
||||
room:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
allOf: [ "$ref": "definitions/push_rule.yaml"]
|
||||
sender:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
allOf: [ "$ref": "definitions/push_rule.yaml"]
|
||||
underride:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
allOf: [ "$ref": "definitions/push_rule.yaml"]
|
||||
|
|
@ -30,6 +30,7 @@ paths:
|
|||
- accessToken: []
|
||||
responses:
|
||||
200:
|
||||
description: All the push rulesets for this user.
|
||||
schema:
|
||||
type: object
|
||||
required: ["device", "global"]
|
||||
|
|
@ -38,21 +39,20 @@ paths:
|
|||
type: object
|
||||
title: Devices
|
||||
description: A dictionary of devices.
|
||||
patternProperties:
|
||||
".*":
|
||||
additionalProperties:
|
||||
x-pattern: "$PROFILE_TAG"
|
||||
type: object
|
||||
description: The ruleset for this profile tag.
|
||||
title: Ruleset
|
||||
allOf: [
|
||||
"$ref": "definitions/push_ruleset.yaml"
|
||||
"$ref": "definitions/push_ruleset.json"
|
||||
]
|
||||
global:
|
||||
type: object
|
||||
description: The global ruleset.
|
||||
title: Ruleset
|
||||
allOf: [
|
||||
"$ref": "definitions/push_ruleset.yaml"
|
||||
"$ref": "definitions/push_ruleset.json"
|
||||
]
|
||||
examples:
|
||||
application/json: |-
|
||||
|
|
@ -292,14 +292,11 @@ paths:
|
|||
}
|
||||
schema:
|
||||
type: object
|
||||
required: ["enabled", "rule_id", "actions"]
|
||||
properties:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether this rule is active or not.
|
||||
rule_id:
|
||||
type: string
|
||||
description: The rule ID from the path.
|
||||
description: The push rule.
|
||||
title: PushRule
|
||||
allOf: [
|
||||
"$ref": "definitions/push_rule.json"
|
||||
]
|
||||
delete:
|
||||
summary: Delete a push rule.
|
||||
description: |-
|
||||
|
|
@ -330,6 +327,14 @@ paths:
|
|||
x-example: "#spam:example.com"
|
||||
description: |
|
||||
The identifier for the rule.
|
||||
responses:
|
||||
200:
|
||||
description: The push rule was deleted.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
put:
|
||||
summary: Add or change a push rule.
|
||||
description: |-
|
||||
|
|
|
|||
Loading…
Reference in a new issue