danielgtaylor / aglio

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

No support for MSON 'One of' #174

Closed seattlevine closed 8 years ago

seattlevine commented 8 years ago

Attributes listed under a 'One of' section do not render. Given:

Only itemC is rendered

danielgtaylor commented 8 years ago

@seattlevine this is a limitation of the Drafter.js depedency, which is being replaced by an updated tool that will hopefully fix many of these types of issues. You can already play with the newer output if you take a look at Protagonist version 1.x, but it'll be at least a few weeks until that output is in Aglio.

seattlevine commented 8 years ago

Great thanks. No problem for us if it's fixed in a few weeks or even months.

danielgtaylor commented 8 years ago

@seattlevine please have another look. The default theme olio-theme-1.6.0 release now includes some support for One Of MSON members. In the generated JSON examples, the first of the One Of items is always chosen. In the generated JSON Schema all options are shown and limited with a "not both required" rule. Please let me know if you run into other issues!

brendensoares commented 6 years ago

@danielgtaylor The theme does not work for nested property lists such as:

+ Attributes
    + One Of
        + Properties
            + a
            + b
        + Properties
            + c
            + d

The latest theme appears to go too deep and only displays the first property of the first option (ie. a).

Setting the DRAFTER_EXAMPLES=1 env var works around this by skipping the theme's logic in favor of the correct Drafter example.

It would also be great if aglio's default theme support the display of ALL options for One Of, not just the first one.