apiaryio / api-blueprint

API Blueprint
https://apiblueprint.org
MIT License
8.64k stars 2.14k forks source link

How to add custom nonHTTP response to Apiary #318

Closed danilvalov closed 5 years ago

danilvalov commented 8 years ago

Hi.

I develop the service with Push notifications (APNS). And i need to add Push notification responses to Apiary. How to do it?

P.S. I use MSON with data structures for generation of API examples.

kylef commented 5 years ago

API Blueprint can only currently describe HTTP although we do have other open issues tracking decoupling HTTP from API Blueprint.

Regarding APNS, this particular API now sits on top of HTTP/2 and thus can be described in API Blueprint. For example:

FORMAT: 1A

# Apple Push Notification Service (APNS)

## Send Notification [POST /3/device/{devicetoken}]

+ Parameters
    + devicetoken: 00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0

+ Request (application/json)

    + Headers

            apns-id: eabeae54-14a8-11e5-b60b-1697f925ec7b
            apns-expiration: 0
            apns-priority: 10

    + Body

            { "aps" : { "alert" : "Hello" }

+ Response 200