Fix level of counts and devices

They are actually within the notification object rather than the top level object. Add titles to objects so it works.
This commit is contained in:
David Baker 2016-04-06 20:21:08 +01:00
parent 89453bfd8c
commit cf850b4270

View file

@ -55,29 +55,31 @@ paths:
"content": { "content": {
"msgtype": "m.text", "msgtype": "m.text",
"body": "I'm floating in a most peculiar way." "body": "I'm floating in a most peculiar way."
} },
}, "counts": {
"counts": { "unread" : 2,
"unread" : 2, "missed_calls": 1
"missed_calls": 1 },
}, "devices": [
"devices": [ {
{ "app_id": "org.matrix.matrixConsole.ios",
"app_id": "org.matrix.matrixConsole.ios", "pushkey": "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/",
"pushkey": "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/", "pushkey_ts": 12345678,
"pushkey_ts": 12345678, "data" : {},
"data" : {}, "tweaks": {
"tweaks": { "sound": "bing"
"sound": "bing" }
} }
} ]
] }
} }
required: ["notification", "counts", "devices"] required: ["notification"]
properties: properties:
notification: notification:
type: object type: object
title: Notification
description: Information about the push notification description: Information about the push notification
required: ["devices"]
properties: properties:
event_id: event_id:
type: string type: string
@ -136,56 +138,58 @@ paths:
description: |- description: |-
The ``content`` field from the event, if present. If the The ``content`` field from the event, if present. If the
event had no content field, this field is omitted. event had no content field, this field is omitted.
counts: counts:
type: object type: object
description: |- title: Counts
This is a dictionary of the current number of unacknowledged
communications for the recipient user. Counts whose value is
zero are omitted.
properties:
unread:
type: integer
description: |- description: |-
The number of unread messages a user has across all of the This is a dictionary of the current number of unacknowledged
rooms they are a member of. communications for the recipient user. Counts whose value is
missed_calls: zero are omitted.
type: integer properties:
unread:
type: integer
description: |-
The number of unread messages a user has across all of the
rooms they are a member of.
missed_calls:
type: integer
description: |-
The number of unacknowledged missed calls a user has
across all rooms of which they are a member.
devices:
type: array
title: Devices
description: |- description: |-
The number of unacknowledged missed calls a user has This is an array of devices that the notification should be sent to.
across all rooms of which they are a member. items:
devices:
type: array
title: Devices
description: |-
This is an array of devices that the notification should be sent to.
items:
type: object
properties:
app_id:
type: string
description: |-
The app_id given when the pusher was created.
pushkey:
type: string
description: The pushkey given when the pusher was created.
pushkey_ts:
type: integer
description: |-
The unix timestamp (in seconds) when the
pushkey was last updated.
data:
type: object type: object
title: PusherData title: Device
description: |- properties:
A dictionary of additional pusher-specific data. For app_id:
'http' pushers, this is the data dictionary passed in at type: string
pusher creation minus the ``url`` key. description: |-
tweaks: The app_id given when the pusher was created.
type: object pushkey:
title: Tweaks type: string
description: |- description: The pushkey given when the pusher was created.
A dictionary of customisations made to the way this pushkey_ts:
notification is to be presented. These are added by push rules. type: integer
description: |-
The unix timestamp (in seconds) when the
pushkey was last updated.
data:
type: object
title: PusherData
description: |-
A dictionary of additional pusher-specific data. For
'http' pushers, this is the data dictionary passed in at
pusher creation minus the ``url`` key.
tweaks:
type: object
title: Tweaks
description: |-
A dictionary of customisations made to the way this
notification is to be presented. These are added by push rules.
responses: responses:
200: 200:
description: A list of rejected push keys. description: A list of rejected push keys.