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.

Multiple separate apis per-application ?

See original GitHub issue

Looks like some configs like OPENAPI_URL_PREFIX are fixed to the application and this prevents the ability to have multiple apis for 1 app. The simplest case I’d think 1 Api() per major-version. So you’d want a completely separate api between /v1/ and /v2/.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sjhewittcommented, Jul 5, 2022

I’m more than happy to rebase the PR if there’s a chance of getting it merged…

1reaction
sjhewittcommented, Sep 27, 2021

I didn’t see this issue and ended up supporting multiple APIs just by passing kwargs down to the DocBlueprintMixin. See #259

This lets you set up the APIs like this:

api1 = Api(
    app,
    spec_kwargs={
        "title": "API 1",
        "version": "v1",
        "openapi_version": "3.0.2",
    },
    doc_kwargs={
        "name": "api-docs-1",
        "url_prefix": "/api1",
        "redoc_url": "https://cdn.jsdelivr.net/npm/redoc@2.0.0-rc.53/bundles/redoc.standalone.js",
        "redoc_path": "/docs",
    },
)

api2 = Api(
    app,
    spec_kwargs={
        "title": "API 2",
        "version": "v0.0.1",
        "openapi_version": "3.0.2",
    },
    doc_kwargs={
        "name": "api-docs-2",
        "url_prefix": "/api2",
        "swagger_ui_url": "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.24.2/",
        "swagger_ui_path": "/docs",
    },
)

The minor drawback is that it doesn’t support configuration through the Flask app.config using namespacing as you have discussed, but given it’s an advanced feature it may be acceptable

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Should we have multiple API endpoints per application in ...
My question is, do I create two separate sets of APIs in APIM for each function app to consume the single API? Or...
Read more >
What happens if you have multiple APIs with different AD ...
Hi @0GiS0, yes you can have multiple APIs with different AD Applications. It is possible to have different apps under a Azure AD...
Read more >
4 APIs at ONCE! | How To Manage Multiple APIs ... - YouTube
Start using RapidAPI Today! https://rapidapi.com/hub?utm_source=youtube.com/codestackr&utm_medium=DevRel&utm_campaign=DevRelLet's say you ...
Read more >
Best way to limit APIs per Application - Auth0 Community
I want to limit my audiences per client when going through code flow. Right now I have multiple applications as well as multiple...
Read more >
Passing multiple Apps in via REST API to retreive metric data
... to retrieve metric data for multiple applications using a single rest call. ... with role based access control applied per application.
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