Multi tenant and Swagger 2

Understood. Indeed the Swagger document doesn't know exactly how to recreate the original URL when the request URL is modified by the tenant middleware.

I'm not sure how easy is to solve this automatically, but in the meanwhile, you can use the OnGetAbsoluteUrl event to manually provide the correct swagger.json URL.