danielgtaylor / aglio

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

Attributes value using minus not rendering correctly #247

Closed adhatama closed 8 years ago

adhatama commented 8 years ago

Hello,

I have attributes like this (see the date attribute):

+ Request (application/json)
    + Attributes
        + description: This is description example (string, required)
        + date: 2016-03-03 (string, required)

When rendered, it shows something like this

Body
{
  "description": "This is description example",
  "date": "2016"
} 

Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "Description"
    },
    "date": {
      "type": "string",
      "description": "03-03 (string, required) - Date"
    }
  },
  "required": [
    "description"    
  ]
}

Can you reproduce it or am i missing something?

Thanks.

nbgo commented 8 years ago

The same problem. Readable Attributes turn into user unfriendly JSON.

kylef commented 8 years ago

As per the MSON specification, - is a reserved character and as such, it should be escaped.

+ Request (application/json)
    + Attributes
        + description: This is description example (string, required)
        + date: `2016-03-03` (string, required)