You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least for our case since we are using hapi views and then we can modify html context to render. So then you can use this context to modify basePath property when instantiating SwaggerUIBundle.
The text was updated successfully, but these errors were encountered:
swagger-js (swagger-client) no longer needs to have mutators for host, basePath or schemes for OpenAPI 2.0.
Mutations can be achieved by current version 3.x in following way:
(async()=>{const{ spec }=awaitnewSwaggerClient({url: 'https://petstore.swagger.io/v2/swagger.json'});spec.host='www.google.com';constswaggerClient=awaitnewSwaggerClient({ spec });constresponse=awaitswaggerClient.apis.pet.findPetsByStatus({status: 'available'});// hits the www.google.comconsole.dir(response);})();
Newer versions of swagger-ui use swagger-js 3.x in a new way (because in API changes of swagger-js 3.x). By implementing the explicit mutators on swagger-js (setHost, setBasePath, setScheme) directly wouldn't help solving the problem in swagger-ui.
Addressing this issue should now be possible purely from swagger-ui by UrlMutatorPlugin.
Could add support for overriding of basePath in specification when loading from SwaggerUIBundle please?
This could fix the issue with multiple basePaths requested in here OAI/OpenAPI-Specification#562
At least for our case since we are using hapi views and then we can modify html context to render. So then you can use this context to modify basePath property when instantiating SwaggerUIBundle.
The text was updated successfully, but these errors were encountered: