0

Is it possible to get Swashbuckle to produce a separate Swagger Schema per WebAPI Action (path)? I can only get a a single combined schema for all actions within the project (or permanently exclude endpoints)?

Otherwise, are there tools that can produce split my combined schema into separate schemas per path?

I've looked through the docs and swagger tooling but can't see anything that can help, only to generate code artifacts for a path from the JSON Schema.

Thanks

1 Answers1

2

SwashBuckle work on all controllers of a given Web API project.

2 ways to achieve this would be to:

  • have one Web API project per needed Swagger schema; simple but requires multiple projects with potentially common references to objects.

  • "cheat" by using its versioning capabilities, making versions become you silo logic (v1 & v2 could become then path1 & path2).

Community
  • 1
  • 1
Benjamin Soulier
  • 2,223
  • 1
  • 18
  • 30
  • Thanks for your response, this is pretty much the conclusion I'm coming to. I was hoping for solution that wouldn't require a major refactoring/deployment change to satisfy a client request. I may resort to writing something myself to split the schema, but would prefer a 'proper' tool. – Martin Jarvis Oct 05 '16 at 09:17
  • Sorry it doesn't do what need; don't forget to mark answer as solution if you think this helped. – Benjamin Soulier Oct 05 '16 at 11:41