danielgtaylor / aglio

An API Blueprint renderer with theme support that outputs static HTML
4.75k stars 480 forks source link

Schema is not rendered nicely #144

Closed aichholzer closed 9 years ago

aichholzer commented 9 years ago

First of all; thank you for aglio, it has made my documentation writing process so much better. The issue: I am not sure it is actually an issue, maybe I am just missing something, but I have something like this:

+ Request (application/json)

    + Headers

            X-AUTH: "87a4778ff70474b474...3541a91d5294e4509b7cad"

    + Attributes
        + photos (required) - destination location of journey
            + key (required) - Upload key
            + caption (required) - Photo caption

    + Body

            {
                "photos": [
                    "key": "y37dmj10jkwof",
                    ‣ "caption": "A world of games",
                    ‣ "tags": [
                        "game",
                        "japan"
                    ]
                ]
            }

The schema is rendered just fine, but as a one-liner:

{"type":"object","properties":{"photos":{"type":"object","properties":{"key":{"type":"string","description":"Upload key"}},"required":["key"],"description":"destination location of journey"}},"required":["photos"],"$schema":"http://json-schema.org/draft-04/schema#"}

Is it possible to render the schema beautifully? - Something like:

{
  "type": "object",
  "properties": {
    "photos": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Upload key"
        },
        "caption": {
          "type": "string",
          "description": "Photo caption"
        }
      },
      "required": [
        "key"
      ],
      "description": "destination location of journey"
    }
  },
  "required": [
    "photos"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Please let me know, thank you.

aichholzer commented 9 years ago

Seems to be related to a typo in my document. I am investigating and will update this issue.

aichholzer commented 9 years ago

It was due to bad formatting indeed.