twskj/pretty-swag

Feature request: support object composition

Closed this issue · 6 comments

Swagger/OpenAPI spec support composing/extending objects via allOf properties as recommended by JSON Schema. However simple proof-of-concept uses of this feature as tested against swagger-ui or swagger-editor instead produces no content in the html generated/presented by pretty-swag.

twskj commented

In my radar, I'll add it as soon as my time open up.

twskj commented

WIP

twskj commented

I just rolled out. Can you help me verify please. :-)

Unfortunately, I've had to switch to using swagger-ui for my project. That tool's features now guide the functionality I use in a painstakingly trial-and-error process. I don't know when I'll have time to offer some public-safe examples or testable samples, but here's a high-level overview from some quick checks:

Several uses of allOf that work in swagger-ui still do not work here. Somewhat specifically, I've got cases of it working for model extension, but failing for aggregation of operation properties (such as aggregating responses or parameters). It's not clear whether parameters based on extended definitions are working - all endpoints that use such parameters are failing catastrophically (no content), but there could be other reasons. (But keep in mind, this is all documentation that works in swagger-ui.)

twskj commented

Thanks for the feedback. I appreciate your time to provide the test case where pretty-swag failed to generate correct output. Maybe just a section that causes problems (all parameter name can all be removed). Swagger-UI is a powerful tool no question about that ;-)

twskj commented

I'll close this for now. Feel free to re-open if you had a chance to revisit pretty-swag.