openapi-generators / openapi-generators/openapi-python-client

docstrings_on_attributes: true removes examples

未关闭
#1,282 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
2k
派生
293
平均合并
34 分钟
30 天内合并 PR
1

描述

Describe the bug
If I add docstrings_on_attributes: true to my config, then example fields in my openapi schemaare removed entirely from the docstrings.

The default behavior seems to be to list first the description and then the example field in the attribute docstring at the top of the class. I'd expect that behavior to be retained when I add docstrings_on_attributes: true

OpenAPI Spec File
A link to an OpenAPI document which produces this issue. Ideally, write a minimal reproduction only containing the problematic pieces.

Desktop (please complete the following information):

  • OS: [e.g. macOS 10.15.1] macOS 15.5
  • Python Version: [e.g. 3.8.0] 3.11.9
  • openapi-python-client version [e.g. 0.1.0] 0.25.1

Additional context
Add any other context about the problem here.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

该 issue 提到了 openapi-python-client 0.25.1 和 docstrings_on_attributes 配置,但没有指定源文件或测试。首先,使用最小的 OpenAPI 文档,在启用和不启用该选项的情况下复现生成的 docstring。完成标准是:启用该选项时,属性 docstring 保留 description 和 example 两个字段。

由索引模型根据 Issue 内容生成。

评估

技术栈
openapi, python
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。