From 4fafe1ab73d1d1edf0c20007d08b8b1511335fc6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 11 Apr 2016 17:56:38 +0100 Subject: [PATCH] Return an object as the root element Because otherwise it's impossible to change later --- api/client-server/pusher.yaml | 145 ++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 69 deletions(-) diff --git a/api/client-server/pusher.yaml b/api/client-server/pusher.yaml index a7052442..97054547 100644 --- a/api/client-server/pusher.yaml +++ b/api/client-server/pusher.yaml @@ -30,81 +30,88 @@ paths: description: The pushers for this user examples: application/json: |- - [ - { - "pushkey": "Xp/MzCt8/9DcSNE9cuiaoT5Ac55job3TdLSSmtmYl4A=", - "kind": "http", - "app_id": "face.mcapp.appy.prod", - "app_display_name": "Appy McAppface", - "device_display_name": "Alice's Phone", - "profile_tag": "xyz", - "lang": "en-US", - "data": { - "url": "https://example.com/_matrix/push/v1/notify" + { + "pushers": [ + { + "pushkey": "Xp/MzCt8/9DcSNE9cuiaoT5Ac55job3TdLSSmtmYl4A=", + "kind": "http", + "app_id": "face.mcapp.appy.prod", + "app_display_name": "Appy McAppface", + "device_display_name": "Alice's Phone", + "profile_tag": "xyz", + "lang": "en-US", + "data": { + "url": "https://example.com/_matrix/push/v1/notify" + } } - } - ] + ] + } schema: - type: array - title: Pushers - items: - type: object - title: Pusher - properties: - pushkey: - type: string - description: |- - This is a unique identifier for this pusher. The value you - should use for this is the routing or destination address - information for the notification, for example, the APNS token - for APNS or the Registration ID for GCM. If your notification - client has no such concept, use any unique identifier. - Max length, 512 bytes. - kind: - type: string - description: |- - The kind of pusher to configure. ``"http"`` makes a pusher that - sends HTTP pokes. ``null`` deletes the pusher. - app_id: - type: string - description: |- - This is a reverse-DNS style identifier for the application. - It is recommended that this end with the platform, such that - different platform versions get different app identifiers. - Max length, 64 chars. - app_display_name: - type: string - description: |- - A string that will allow the user to identify what application - owns this pusher. - device_display_name: - type: string - description: |- - a string that will allow the user to identify what device owns - this pusher. - profile_tag: - type: string - description: |- - This string determines which set of device specific rules this - pusher executes. - lang: - type: string - description: |- - The preferred language for receiving notifications (e.g. 'en' - or 'en-US') - data: + type: object + properties: + pushers: + type: array + title: Pushers + description: |- + An array containing the current pushers for the user + items: type: object - description: |- - A dictionary of information for the pusher implementation - itself. If ``kind`` is ``http``, this should contain ``url`` - which is the URL to use to send notifications to. - title: PusherData + title: Pusher properties: - url: + pushkey: + type: string + description: |- + This is a unique identifier for this pusher. The value you + should use for this is the routing or destination address + information for the notification, for example, the APNS token + for APNS or the Registration ID for GCM. If your notification + client has no such concept, use any unique identifier. + Max length, 512 bytes. + kind: + type: string + description: |- + The kind of pusher to configure. ``"http"`` makes a pusher that + sends HTTP pokes. ``null`` deletes the pusher. + app_id: type: string description: |- - Required if ``kind`` is ``http``. The URL to use to send - notifications to. + This is a reverse-DNS style identifier for the application. + It is recommended that this end with the platform, such that + different platform versions get different app identifiers. + Max length, 64 chars. + app_display_name: + type: string + description: |- + A string that will allow the user to identify what application + owns this pusher. + device_display_name: + type: string + description: |- + a string that will allow the user to identify what device owns + this pusher. + profile_tag: + type: string + description: |- + This string determines which set of device specific rules this + pusher executes. + lang: + type: string + description: |- + The preferred language for receiving notifications (e.g. 'en' + or 'en-US') + data: + type: object + description: |- + A dictionary of information for the pusher implementation + itself. If ``kind`` is ``http``, this should contain ``url`` + which is the URL to use to send notifications to. + title: PusherData + properties: + url: + type: string + description: |- + Required if ``kind`` is ``http``. The URL to use to send + notifications to. tags: - Push notifications "/pushers/set":