danielgtaylor / aglio

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

Data Structures in response aren't fully generated #188

Closed elizabeth-young closed 9 years ago

elizabeth-young commented 9 years ago

Hi,

Thanks for this library I have found it really useful.

After updating to version 2.2.0 I've found that my data structures are not being fully generated for responses, the updated examples also have this issue.

Previous example: previous response object using data structures

Version 2.2.0 example: version 2 2 0 response object using data structures

Thanks.

pavel-main commented 9 years ago

Experiencing same issue.

hwestbrook commented 9 years ago

same issue

danielgtaylor commented 9 years ago

@elizabeth-young @kpashka @hwestbrook thanks for reporting the issue. This is a regression in the new version of one of our dependencies, called Protagonist, which is itself a Node.js binding for Drafter. The main reason for moving to the new Protagonist is to support new upcoming features and support Node.js 4.x and 5.x. Currently, there are several regressions being fixed over in the Drafter repository.

Once those get fixed, a new version of Drafter will be released, then a new version of Protagonist and then when you install Aglio it will pick up the fixes. I will also do a patch release requiring the fixed version as the minimum allowed version.

Sorry about these issues, but I was feeling a lot of pain lacking support for Node.js 4.x and 5.x along with some parser bugs which have gotten fixed in the new version. At this point you have two options:

Another issue related to the above is the lack of JSON Schema being generated with the new Protagonist. This is because the library used for that in the past was generating incorrect schemas, so it has been disabled until it can be fixed. Work will be started shortly to get JSON Schema support working in Drafter itself. Again I apologize for the inconvenience, and I've had to make some difficult and inconvenient choices with what to support during this transitional period moving to the new Drafter/Protagonist.

Please feel free to chime in on the Drafter issues or open new bugs on that repository to address any other MSON and related parser issues that you find.

danielgtaylor commented 9 years ago

Just a quick update on the JSON Schema support: I have quickly written a simple JSON Schema generator and released it in the 1.4.0 version of the default Olio theme engine. If you reinstall Aglio you will get it, and it will generate schemas from MSON. It works with the example that I ship with Aglio (example output), but consider it beta quality as it doesn't support all MSON features. The link above explains what it does support.

This does not help with the JSON body generation, which is handled within Drafter. Those bugs are in the process of being fixed, as explained above. Unfortunately there is no quick fix for them.

hwestbrook commented 9 years ago

Thanks @danielgtaylor. I plan to downgrade aglio and node until this is resolved.

elizabeth-young commented 9 years ago

Thanks for the update @danielgtaylor

danielgtaylor commented 9 years ago

@hwestbrook @elizabeth-young please have another look, I've implemented a JSON example generator in Aglio that should support most features that the older Drafter did. Here is the example blueprint showing both a working JSON body and JSON Schema. Let me know if you have any issues!

You'll need to reinstall Aglio to get the Olio theme 1.5.0.

danielgtaylor commented 9 years ago

Closing as this should be fixed. Please reopen if you feel like I've missed something important!