最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to get route of request from connexion.AsyncApp in python? - Stack Overflow

programmeradmin3浏览0评论

I have an connexion.AsyncApp in python. A snippet of the code looks like this:

app = AsyncApp(__name__)
app.add_api("openapi.yaml", arguments={"title": "Async APP API"})


if __name__ == "__main__":
    uvicorn.run(app, host="127.0.0.1", port=8000)

I've been trying to determine how to access the route of an incoming request. I attempted to add middleware before SwaggerUIMiddleware using self.app.add_middleware(), assuming the route information would be available at that point. However, after inspecting the object received in the middleware, I couldn't find any member variables containing this information.

I sent a request to an endpoint similar to /greetings/{user} but couldn't see the route with {user} as a placeholder. Instead, I only saw the actual username.

Is there no easy way to find the route information with connexion async app?

发布评论

评论列表(0)

  1. 暂无评论