I call swaggerui with http://localhost:2018/api/TENANT/swaggerui. That's fine and the tenant is identified.
However, the swaggerui page calls http://localhost:2018/api/openapi/swagger.json without the tenant id included in the first call, so the swaggerui does not display, it just shows the error:
Fetch error
Not Found http://localhost:2018/api/openapi/swagger.json
which is correct as the middletier tenant would read 'openai' as the tenant id.
So how do you make the swaggerui page make the call with the tenant id in the url?
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.