twskj / pretty-swag

Pretty UI for Swagger spec
MIT License
122 stars 20 forks source link

Feature request: support object composition #30

Closed evan-king closed 7 years ago

evan-king commented 7 years ago

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 7 years ago

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

twskj commented 7 years ago

WIP

twskj commented 7 years ago

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

evan-king commented 7 years ago

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 7 years ago

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 7 years ago

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