danielgtaylor / aglio

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

boolean type in Data Structures prevents Request Body #153

Closed jonwurtzler closed 9 years ago

jonwurtzler commented 9 years ago

When I use the boolean type for a field in a Data structure, the generated response no longer has a Body section.

If I have the following:

# Group Test
## Test a Call [/test]
### Run the Test [PUT]

+ Request (application/json)
  + Attributes (TestObject)

# Data Structures
## TestObject (object)
+ switch: `1` (boolean, required) - Boolean object.

It will compile just fine, but the Request Body section will be missing. Headers and Schema will be there and look just fine. If I change the boolean type to a number type, the Body section will return.

kylef commented 9 years ago

Hi @jonwurtzler, the sample value you've provided for your switch property is a number and not a boolean value.

Simply switching this to be a boolean value such as true or false should make this work.

# Data Structures
## TestObject (object)
+ switch: true (boolean, required) - Boolean object.
jonwurtzler commented 9 years ago

Sure enough, that works just fine. I feel rather foolish.

Thank you for the update.