widdershins icon indicating copy to clipboard operation
widdershins copied to clipboard

Allow to pass an array instead of single apiObj for microservices

Open neverlan opened this issue 6 years ago • 8 comments

Instead of passing an apiObj, we could pass an array of apiObj to convert into a markdown with nested fields (h1, h2, h3) for microservices

neverlan avatar Oct 30 '17 15:10 neverlan

Although this is a good idea, and we can consider it further, in the Unix spirit of "doing one thing and doing it well", have you looked at https://github.com/Typeform/openapi-micro-merge ? It might suit your needs as a pre-processing step before calling widdershins?

MikeRalphson avatar Oct 30 '17 15:10 MikeRalphson

Also some more work is necessary to get more / variable levels of header support in the TOC.

MikeRalphson avatar Oct 30 '17 16:10 MikeRalphson

Thanks for pointing out to openapi-micro-merge.

Unfortunately it does not suits my needs as it merge all swagger files into one file - resulting in duplicate entries.

Tweaking around widdershins would work. I think manually generating the header and only the markdown for each of the swagger files would be fine.

neverlan avatar Oct 30 '17 17:10 neverlan

If openapi-micro-merge creates duplicate entries, it might be worth raising an issue there?

It won't be trivial to adapt Widdershins to output multiple definitions with all the h1s, h2s etc shifted down by one level (if that's what you want), though I will bear it in mind for the upcoming rewrite of the OpenAPI templates.

MikeRalphson avatar Oct 31 '17 11:10 MikeRalphson

Is this any better for your use-case with Widdershins v3.0.x?

MikeRalphson avatar Dec 14 '17 07:12 MikeRalphson

I am not sure. How 3.0.x improve my use case ? Can you provide a quick example ?

neverlan avatar Jan 23 '18 11:01 neverlan

It should be easier to amend the stock templates to increase the heading levels by one in v3.0.x and combine using a version of your script. Other than that, there is no additional support yet.

MikeRalphson avatar Jan 23 '18 11:01 MikeRalphson

A note that @shreyas-agnihotri had the same issue/request. Mentioned https://github.com/maxdome/swagger-combine, though https://github.com/Typeform/openapi-micro-merge also worth looking at. Both OpenAPI 2.0 only as far as I can see.

MikeRalphson avatar Jan 26 '18 09:01 MikeRalphson