How should basePaths for multiple environments be specified?
See original GitHub issueFor instance, development vs test vs staging vs production?
We’ve been putting them in a parallel basePaths
like:
{
basePath: 'http://api.example.com'
basePaths: {
development: 'http://api.dev-example.com',
test: 'http://api.test-example.com',
stage: 'http://api.stage-example.com',
production: 'http://api.example.com'
}
}
Issue Analytics
- State:
- Created 9 years ago
- Reactions:4
- Comments:17 (8 by maintainers)
Top Results From Across the Web
API Server and Base Path - Swagger
In OpenAPI 3.0, you use the servers array to specify one or more base URLs for your API. servers replaces the host ,...
Read more >Different base paths depending on Development/Production ...
First I changed the base url so that only when the Development environment variable is found, the base url /UserManagement will be used:...
Read more >Multiple revisions deployed in an environment
This is more of a conceptual question. I can deploy multiple revisions of the same API to the same environment through the deployment...
Read more >How to Model Your Gitops Environments - Codefresh
These settings belong to the set of configuration that we don't expect to promote between environments, but we assume that they will be...
Read more >API from multiple hosts/base paths - Spec - RAML Forum
One of the related use case I find is to host in multiple environments (e.g. dev, test, staging, prod) and able to specify...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In Swagger 2.0 the definition of
basePath
has changed. It has been split to 3 properties -scheme
,host
andbasePath
. ThebasePath
now becomes the actual base path which is relative to the host. If the host is not specified, the basePath is taken against the host that’s serving the specification. Does this answer your need?@shelbys - it does not directly cover it. I’m just saying that if you don’t include them, and host your swagger.json on each of those environment separately, you wouldn’t need to change the basePath each time for the relevant environment.
We’re working on a way to document several micro-services, but even there you’d need to duplicate your swagger.json with a different basePath. You’d have a centralized description though of the different environments.