Igorek
Igorek

Reputation: 15841

Showing Swagger UI for API in a different project (Swashbuckle)

We have a .NET solution with 2 projects:

We are trying to expose a public documentation to a few API controllers in the OWIN-based API project We would like to show the Swagger UI from the Portal project for controllers in the API project

So far, all attempts have not been successful. When adding Swagger UI to the Portal project, it only wants to show documentation about controllers in the Portal project, not from the API project.

When adding Swagger UI to the API project (not preferred solution), it doesn't work at all, probably because of the custom controller selector

However, I think I'm missing something obvious as this feels like a very basic configuration setting that we're missing

Upvotes: 5

Views: 3030

Answers (1)

Arnaud Lauret
Arnaud Lauret

Reputation: 5331

Swagger UI is only a set a static file rendering OpenAPI (fka. Swagger) Specification files. These specification files can be produced by an application or simply manually written.

You could modify the original Swagger UI to create your own version and replace the URL field (on top near the Authorize button) by a drop list pointing to your 2 different applications producing OpenAPI (fka. Swagger) specification.

Upvotes: 2

Related Questions