-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should basePaths for multiple environments be specified? #106
Comments
In Swagger 2.0 the definition of |
can you please describe the use case for 'scheme'? |
|
I looked at https://github.com/wordnik/swagger-spec/blob/master/schemas/v2.0/schema.json and don't see the basePath structure you mentioned.. am i missing something here?? thx. |
Thanks! Just making sure i understand how this works. however, if i have |
That is correct. And as said, you can omit the host and scheme to allow for a more dynamic association should you need it. It can be especially useful when serving a static swagger.json rather than generating one. Also, I didn't mention it before (though it's documented in the spec itself), host can also include a port in it. |
excellent. Thanks. |
@webron - I don't think the new structure covers this, unless I'm missing something. How would I document four different environments in one spec file using the 2.0 syntax? Any of the three components (i.e. schema, host, and/or basePath) could be different for each environment. We try to only change the host, but I've seen the others as well |
@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. |
Grr, "Close" and "Comment" are too close together @webron - We're specifically looking to document all of the environments in one place, so end-users know where they can try things out before hitting Prod. I think this is generally applicable, but particularly important when documenting APIs for other groups within an organization |
okay, let's revisit this once the micro services solution is published (should be within the next few days), and if it doesn't satisfy your needs, we'll mark it as a request for the next version. |
Has this been implemented now? I'm still confused on how to use different hosts for different environments. I only want to be able to use the same |
Closing in favor of #562. |
@webron If I understand correctly from the resolution in #562 and the merged patch in #604, that won't allow to specify multiple global base paths based on "environments" as described at the beginning of this issue:
The solution on #562 only supports overriding schema/host/past at the operation level. Shouldn't we reopen this ticket then? (Or perhaps closing it with the explicit reason that OpenAPI won't support this use case) cc: @fehguy |
@leosoto - we've decided that supporting environments is outside the scope. |
@webron environment support is outside the scope. :( I was waiting for it since long time. |
For instance, development vs test vs staging vs production?
We've been putting them in a parallel
basePaths
like:The text was updated successfully, but these errors were encountered: