RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.69k stars 1.24k forks source link

Single Doc for multiple APIs #2717

Open Wataker0912 opened 4 years ago

Wataker0912 commented 4 years ago

Hello, search didn't yield much results, I was curious if it would be possible to maintain a centralized swagger doc with multiple APIs/ controllers across separate C# solutions? Thanks!

RicoSuter commented 4 years ago

Either you reference all controller project in one master project just for gen or you need to merge the docs:

https://github.com/RicoSuter/NSwag/issues/1273#issuecomment-391641275

Wataker0912 commented 4 years ago

ok cool, I was able to add a master proejct with references to each controller, although they seem to load in just one long scrolling page, no real organization. Is there a way I can organize them by name or title or something? Thanks!

RicoSuter commented 4 years ago

Arent they grouped by tag (tag == controller name)?

Wataker0912 commented 4 years ago

Yes they are, sorry I meant organize them as in a 'Title' for each set of controllers which come from the same project. So if I had 5 Controllers from one project called 'Pets', list them all under 'Pets, 2 from 'Fish', put them under 'Fish' etc. Thanks!

RicoSuter commented 4 years ago

You can write an operation processor and change the operation tags there: https://github.com/RicoSuter/NSwag/wiki/Document-Processors-and-Operation-Processors