Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

All GetXXXResponseContent types declare all fields as Optional in Management API

Abierto
#798 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python
Área
api, backend

Línea de trabajo

Comienza localizando los modelos GetXXXResponseContent utilizados por los endpoints .get() de Management API y compara sus campos con la documentación de la API enlazada. Identifica los campos documentados como siempre presentes, haz que su tipado de respuesta no sea opcional y verifica las anotaciones actualizadas en endpoints representativos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
581
Forks
189
Merge medio
15 h 33 min
PR fusionados (30 d)
6

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de auth0/auth0-python

Todos los issues de auth0/auth0-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.