apiaryio / api-blueprint

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

Nested data structures don't render correctly #454

Closed ir-fuel closed 4 years ago

ir-fuel commented 4 years ago

This is the document

## Data structures

### Location(object)
    + latitude (number,required)
    + longitude (number,required)

### Result(object)
    + id (string,required)
    + location (Location,required)

## Collection [/user]

### Update user profile 2 [PATCH /user2/{id}]

+ Parameters
    + id (string) - Id of the user

+ Request 

    + Attributes (object)
        + testBool (boolean)
        + arr (array[Result])

    + Body

            {
            }

+ Response 204

This is what it looks like when rendering this:

Screenshot 2019-12-23 at 09 24 58

As you can see the nested Location data structure is not shown correctly

kylef commented 4 years ago

The indentation of the items is incorrect and thus it is being treated as a description block (code block specifically), try removing indentation of the resuable data structures, for example:

### Location(object)

+ latitude (number,required)
+ longitude (number,required)

### Result(object)

+ id (string,required)
+ location (Location,required)
ir-fuel commented 4 years ago

Right. I discovered this too in the mean time but forgot about this ticket ...