All GetXXXResponseContent types declare all fields as Optional in Management API
まだ誰も着手していません。
評価
調査の方向性
まず、Management API の .get() エンドポイントで使用される GetXXXResponseContent モデルを見つけ、フィールドをリンク先の API ドキュメントと比較します。常に存在するとドキュメントに記載されているフィールドを特定し、それらのレスポンスの型付けを非オプショナルに変更して、代表的なエンドポイント全体で更新されたアノテーションを確認します。
索引モデルが issue の本文から書いたものです。
説明
Checklist
- I have looked into the Readme and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
The return types for .get() functions declare all fields to be optional. An example here for an organization:
class GetOrganizationResponseContent(UniversalBaseModel):
id: typing.Optional[str] = pydantic.Field(default=None)
"""
Organization identifier.
"""
name: typing.Optional[str] = pydantic.Field(default=None)
"""
The name of this organization.
"""
display_name: typing.Optional[str] = pydantic.Field(default=None)
"""
Friendly name of this organization.
"""
branding: typing.Optional[OrganizationBranding] = None
metadata: typing.Optional[OrganizationMetadata] = None
token_quota: typing.Optional[TokenQuota] = None
However the API documentation does not say id, display_name or name can be None : https://auth0.com/docs/fr-ca/api/management/v2/organizations/get-organizations
This forces developers to correct the typing after the fact with typing.cast or disable typing of the concerned lines.
Reproduction
- Call any endpoint in the Management API
- Use a field that should never been None (for exemple user.email or user.id)
- The IDE or type checker will warn you this field could be None.
Additional context
No response
auth0-python version
5.1.0
Python version
3.12
- 主要言語
- Python
- スター
- 581
- フォーク
- 189
- 平均マージ
- 15時間 33分
- マージ済み PR(30日)
- 6
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
auth0/auth0-python のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
auth0/auth0-python#852 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
auth0/auth0-python#856 · コメント 4 件 · リアクション 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
auth0/auth0-python#789 · コメント 1 件 · リアクション 1 件 ·
auth0/auth0-python の issue をすべて見る
似ている issue
-
essnmx good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
[Feature] 奇物选择添加优先级 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
syfoud/Simulated_Scepter#174 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Giskard-AI/giskard-oss#2840 · コメント 1 件 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success オープンarea: repo bug perceived difficulty: 2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
yeti-platform/yeti#1380 ·