Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

All GetXXXResponseContent types declare all fields as Optional in Management API

Aperta
#798 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
api, backend

Direzione di ricerca

Inizia individuando i modelli GetXXXResponseContent utilizzati dagli endpoint .get() della Management API e confronta i loro campi con la documentazione API collegata. Individua i campi documentati come sempre presenti, rendi non opzionale la tipizzazione delle loro risposte e verifica le annotazioni aggiornate su endpoint rappresentativi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
581
Fork
189
Merge medio
15h 33m
PR unite (30g)
6

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di auth0/auth0-python

Tutte le issue di auth0/auth0-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.