Enhance OpenAPI Generator Pydantic Models with typings
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
Start by locating the Jinja2 model template that generates the Pydantic classes, then inspect spec/sdk_test.py around the reported constructor usage. Compare explicit init generation with the alternative .pyi approach. Done means regenerated models accept snake_case arguments at runtime and MyPy passes without call-arg ignores.
索引モデルが issue の本文から書いたものです。
説明
Title: Enhance OpenAPI Generator Pydantic Models with Explicit __init__ Signatures for Snake‑case Fields
What
Our generated Pydantic models only declare field aliases, not an explicit constructor signature, so MyPy reports errors when consuming code passes snake_case keyword arguments:
Minimal example
# Generated by OpenAPI Generator (no explicit __init__)
class V2SetHumanProfile(BaseModel):
given_name: Annotated[str, Field(alias="givenName")]
family_name: Annotated[str, Field(alias="familyName")]
# … other fields …
# In test or client code:
profile = V2SetHumanProfile(
given_name="John",
family_name="Doe",
)
spec/sdk_test.py:35: error: Unexpected keyword argument "given_name" for "V2SetHumanProfile"; did you mean "givenName"? [call-arg]
At runtime, Pydantic’s populate_by_name=True accepts given_name/family_name, but MyPy only “sees” the aliased fields and so flags the snake_case kwargs as invalid.
Why
- Improved DX & autocompletion
Developers expect Python‑style constructor arguments (given_name, notgivenName). - Stronger static guarantees
Eliminates the need for# type: ignore[call-arg]or hand‑written stubs. - Consistency
Keeps runtime behavior and static types in sync.
How
-
Inject explicit
__init__in the generator template
Update the Jinja2 model template to emit a constructor exposing snake_case names: -
(Alternative) Generate
.pyistubs
Produce companion stub files with explicit__init__signatures. -
Regenerate the SDK & validate
- Run the generator with the updated template.
- Confirm constructors accept snake_case args.
- Verify MyPy passes without ignores.
- 主要言語
- Python
- スター
- 16
- フォーク
- 3
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
zitadel/client-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
zitadel/client-python#125 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
zitadel/client-python#140 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
zitadel/client-python#99 ·
-
Release SDK for V5 オープン
zitadel/client-python#80 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
zitadel/client-python#78 ·
zitadel/client-python の issue をすべて見る
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100