Forum Discussion
HKosova
5 years agoSmartBear Alumni (Retired)
Hi Steve,
To prevent the host and basePath from being overwritten, disable the "Update host setting" option in API Auto Mocking settings. In this case, the API definition and "try it out" will point to your original host/basePath, but you can still make requests to the mock server using cURL, Swagger Inspector, or similar tools.
curl -X GET https://virtserver.swaggerhub.com/MyOrg/MyApi/1.0.0/<endpoint_path>
Alternatively, consider using OpenAPI 3.0 instead - in this case the mock server will be added as a separate entry in the servers list:
servers:
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/MyOrg/MyApi/1.0.0
- url: 'https://petstore.swagger.io/v2'
Related Content
- 3 years ago
- 7 months ago
Recent Discussions
- 22 days ago
- 2 months ago