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 摘要。