Атрибуты Apiary Blueprint под заголовками и телом не распознаются

Окончательное редактирование: это работает без семантических ошибок:

+ Request

    + Headers

            Accept: application/json
            Content-Type: application/json
            X-Auth-Client: Your Client Id
            X-Auth-Token: Your Token

    + Body

    + Attributes (ProductPost)


+ Response 200

    + Headers

            Content-Encoding: Entity header is used to compress the media-type.
            Content-Type: application/json
            Date: The date the response was sent.
            Transfer-Encoding: Header specifies the form of encoding used to safely transfer the entity to the user.
            Vary: HTTP response header determines how to match future request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. We use Accept Encoding
            X-Rate-Limit-Requests-Left: Header details how many remaining requests your client can make in the current window before being rate-limited. 
            X-Rate-Limit-Requests-Quota: Header shows how many API requests are allowed in the current window for your client 
            X-Rate-Limit-Time-Reset-Ms: Header shows how many milliseconds are remaining in the window. 
            X-Rate-Limit-Time-Window-Ms: Header shows the size of your current rate-limiting window

    + Body

    + Attributes (ProductResponse)

Изменить: раздел заголовка отображается, но теперь в разделе «Тело» отображается текст «+ Атрибуты (ProductPost)».

+ Request

    + Headers

            Accept: application/json
            Content-Type: application/json
            X-Auth-Client: Your Client Id
            X-Auth-Token: Your Token



+ Response 200

    + Headers

            Content-Encoding: Entity header is used to compress the media-type.
            Content-Type: application/json
            Date: The date the response was sent.
            Transfer-Encoding: Header specifies the form of encoding used to safely transfer the entity to the user.
            Vary: HTTP response header determines how to match future request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. We use Accept Encoding
            X-Rate-Limit-Requests-Left: Header details how many remaining requests your client can make in the current window before being rate-limited. 
            X-Rate-Limit-Requests-Quota: Header shows how many API requests are allowed in the current window for your client 
            X-Rate-Limit-Time-Reset-Ms: Header shows how many milliseconds are remaining in the window. 
            X-Rate-Limit-Time-Window-Ms: Header shows the size of your current rate-limiting window


    + Body

            + Attributes (ProductCollectionResponse)

Я пытаюсь определить тело запроса и после прочтения этого: https://help.apiary.io/api_101/apib-authentication/ & https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md#def-headers-section

Казалось, что я могу разделить их на разделы. Но раздел атрибутов не распознается. Это запрос /GET.

Есть идеи, почему?

+ Request (application/json)

    + Headers

        + Attributes (RequestHeaders) 

    + Body

        + Attributes (ProductPost)

person T.J.    schedule 03.05.2018    source источник


Ответы (1)


Раздел заголовков не может содержать атрибуты, вам необходимо определить их явно. Просто замените:

    + Attributes (RequestHeaders) 

с определением RequestHeaders.

Также попробуйте выровнять Тело и Атрибуты в одном столбце:

+ Body
+ Attributes (ProductPost)
person Alex    schedule 03.05.2018
comment
Я так и сделал, но теперь тело не рендерится. Я добавил обновление в вопросе выше - person T.J.; 03.05.2018
comment
@Т.Дж. удалить пустую строку после Body и выровнять их в одном столбце - person Alex; 03.05.2018
comment
@Т.Дж. не выравнивайте по одному и тому же столбцу, просто удалите пустую строку - person Alex; 03.05.2018
comment
ответ не должен содержать заголовков - person Alex; 03.05.2018
comment
Ответ Алекса 200 содержит заголовки для нашего API и включает необходимую информацию об ограничении скорости. - person T.J.; 03.05.2018
comment
Давайте продолжим обсуждение в чате. - person Alex; 03.05.2018