question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reconsider multiple basePath values

See original GitHub issue

This was one of those features that shipped with swagger 1.0, 1.1, and 1.2 but was removed in 2.0.

The current spec does not allow multiple hosts to be defined for execution. You can host the spec in different pieces and across multiple hosts, but the execution shall be for a single host. That host is configurable in the spec, but it applies to all operations.

There has been pushback on this from a number of people so I’d like to put it back out in the open. We can reintroduce a construct for multiple hosts. Having gone through the pains of both implementing and supporting it in tools, I would strongly suggest we do not.

My reasoning:

  • Often different hosts have different authorization mechanisms. If we re-introduce this feature, we’ll need to support scoping authorizations to a particular host.
  • Spanning different protocols (calling a http operation from a https-hosted page, for example) introduces show-stopping compatibility issues for web-based tools. Multiple hosts in a single spec will exacerbate this issue
  • The original support was intended for microservices, which is now better served by apis.json.

So this ticket gives some background and a recommendation for the next version. If there is strong objection, now is the time.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
IvanGoncharovcommented, Feb 10, 2016

I think we should consider real life scenarios for this issue. Most common is separate base paths for file uploads, for example in Google APIs https://www.googleapis.com/drive/v3 https://www.googleapis.com/upload/drive/v3

https://www.googleapis.com/youtube/v3 https://www.googleapis.com/upload/youtube/v3

Or different subdomain: https://uploady.com/v1/api/ https://content.uploady.com/v1/api/

https://api.dropboxapi.com/2 https://content.dropboxapi.com/2

I think RAML have pretty good solution for this problem: https://github.com/raml-org/raml-spec/blob/master/raml-0.8.md#base-uri-parameters

And I think template parameters in host and basePath also needed for other things like separate subdomain for sandbox, allow to choose server location, etc.

1reaction
november1306commented, Jul 25, 2018

creating separate spec document with code duplication if you have more than one subdomain is so stupid

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple basepaths - Google Cloud Community
Is there a way for an apiproxy to handle multiple basepaths? We currently have a hard-coded API prefix on all our proxies as...
Read more >
ASP.NET Core 2.1 Setting BasePath of appsettings.json for ...
I have these 2 solutions with this structure ... error that says that the application can't find sone.json using the basepath of Solution2....
Read more >
Race and the Spalding World Baseball Tour - jstor
Basepaths to Empire: Race and the Spalding World Baseball Tour* by Thomas W. Zeiler, University of Colorado at Boulder. During the Gilded Age, ......
Read more >
KONTAKT Manual - Native Instruments
been used by other Instruments in your Multi yet. • Non-Player content base path: Allows you to specify a base path for your...
Read more >
Directory Services 6.5 > Administration Guide
Directories' entries on the other hand are often indexed for multiple ... The directory server then returns entries with attribute values that match...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found