apiaryio / api-blueprint

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

`array` seems to be breaking this attributes object #331

Closed kirkstrobeck closed 8 years ago

kirkstrobeck commented 8 years ago
+ Response 200 (application/json)

    + Attributes (object)

        + meta (object)
          + doable: true (boolean) - Is this trip possible?
          + milesRemaining: 20 (number) - Number of miles remaining
          + currentChargePercent: 10 (number) - Percent of charge remaining
        + stops (array)
          + (object)
            + location (object) - A Tesla location object
            + milesRemaining: 20 (number) - Number of miles remaining
            + currentChargePercent: 10 (number) - Percent of charge remaining
kirkstrobeck commented 8 years ago

This wont work either

+ Response 200 (application/json)

    + Attributes (object)

        + meta (object)
          + doable: true (boolean) - Is this trip possible?
          + milesRemaining: 20 (number) - Number of miles remaining
          + currentChargePercent: 10 (number) - Percent of charge remaining
        + stops (array[object])
          + location (object) - A Tesla location object
          + milesRemaining: 20 (number) - Number of miles remaining
          + currentChargePercent: 10 (number) - Percent of charge remaining
kylef commented 8 years ago

@kirkstrobeck The problem here is that some of the list items are not intended via 4 spaces relative to their parent so they are not being parsed correctly.

The following should solve your problem:

+ Response 200 (application/json)
    + Attributes (object)
        + meta (object)
            + doable: true (boolean) - Is this trip possible?
            + milesRemaining: 20 (number) - Number of miles remaining
            + currentChargePercent: 10 (number) - Percent of charge remaining
        + stops (array)
            + (object)
                + location (object) - A Tesla location object
                + milesRemaining: 20 (number) - Number of miles remaining
                + currentChargePercent: 10 (number) - Percent of charge remaining
kirkstrobeck commented 8 years ago

thx @kylef