apiaryio / api-blueprint

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

Api Blueprint use Body and Attributes together but keeps specified Body's JSON #439

Closed angeloatleadiq closed 5 years ago

angeloatleadiq commented 5 years ago

I have a apib file like this and I want the response body to show instead of the generated body from Attributes (SearchResult) but I can't remove Attributes (SearchResult) because I want to keep the generated schema from Attributes (SearchResult).

FORMAT: 1A
HOST: host.com

# Data Structures

## SearchResult
+ totalResults (required, number)
+ hasMore (required, boolean)
+ results (required, Record)

# Group Record Search

## Query [/api/graphql]

### Search Record [POST]

+ Response 200 (application/json)

    + Attributes (SearchResult)

    + Body
         {
           "data": "this is the response"
         }

The generated html from aglio would have the Responses body generated from Attributes (SearchResult) instead of showing this specified body.

Body

{
   "data": "this is the response"
}
kylef commented 5 years ago

Hi @angeloatleadiq, this is a question specific to Aglio as the parser behaves correctly in this matter. Other renders such as Apiary are rendering this correctly.

Aglio is specifically generating its own body from the attributes, there is an open issue tracking this at https://github.com/danielgtaylor/aglio/issues/357.

screenshot 2018-10-17 at 12 32 07