Skip to content
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

support relative basePath #52

Closed
fehguy opened this issue May 6, 2014 · 2 comments
Closed

support relative basePath #52

fehguy opened this issue May 6, 2014 · 2 comments

Comments

@fehguy
Copy link
Contributor

fehguy commented May 6, 2014

It seems like the requirement for absolute base path for apis is very difficult for folks. I propose we still support it, but allow the spec & tooling to support relative paths.

The rule would be as follows:

if url starts with "http" it will be considered absolute. Otherwise, the scheme, host, and protocol will be derived from the location of the Api Declaration which is being served.

Since this is incremental, and still supports the absolute path that the spec requires, I believe it can be amended to the 1.2 spec w/o a revision.

@webron
Copy link
Member

webron commented May 7, 2014

I'm not sure we can add it as an amendment to the 1.2 spec as it may break
3rd party tools.

On Wed, May 7, 2014 at 1:41 AM, Tony Tam notifications@github.com wrote:

It seems like the requirement for absolute base path for apis is very
difficult for folks. I propose we still support it, but allow the spec &
tooling to support relative paths.

The rule would be as follows:

if url starts with "http" it will be considered absolute. Otherwise, the
scheme, host, and protocol will be derived from the location of the Api
Declaration which is being served.

Since this is incremental, and still supports the absolute path that the
spec requires, I believe it can be amended to the 1.2 spec w/o a revision.


Reply to this email directly or view it on GitHubhttps://github.com//issues/52
.

fehguy added a commit that referenced this issue Sep 8, 2014
@webron
Copy link
Member

webron commented Sep 19, 2014

In Swagger 2.0, the basePath was split into 3 parts - scheme, host and basePath (this one being the path only). If either scheme or host are not specified, it is assumed that the scheme and host used to serve the specification are the ones used for the API calls as well.

@webron webron closed this as completed Sep 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants