openapi-generators / openapi-generators/openapi-python-client
Auto generated use of the client with context manager is wrong
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 2k
- 派生
- 293
- 平均合并
- 34 分钟
- 30 天内合并 PR
- 1
描述
There should be a new instance every time we use the with statement. because if not the next time you use the client you'll get "Cannot reopen a client instance, once it has been closed."
Like in this example you should write in the docs:
with Client(base_url="Somthing") as client:
and not:
with client as client:
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
该 issue 没有指出任何 repository 文件或测试;先定位生成的 Client 上下文管理器模板和文档示例,然后将它们与链接的 HTTPX 示例进行比较。当生成的用法和文档一致地展示每条 with 语句使用一个全新的 client,并且任何相关的回归检查都通过时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- api, documentation
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100