Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

All GetXXXResponseContent types declare all fields as Optional in Management API

オープン
#798 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
api, backend

調査の方向性

まず、Management API の .get() エンドポイントで使用される GetXXXResponseContent モデルを見つけ、フィールドをリンク先の API ドキュメントと比較します。常に存在するとドキュメントに記載されているフィールドを特定し、それらのレスポンスの型付けを非オプショナルに変更して、代表的なエンドポイント全体で更新されたアノテーションを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug
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
  1. Call any endpoint in the Management API
  2. Use a field that should never been None (for exemple user.email or user.id)
  3. 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

auth0/auth0-python のほかの issue

auth0/auth0-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。