All GetXXXResponseContent types declare all fields as Optional in Management API
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 52/100
Direção de pesquisa
Comece localizando os modelos GetXXXResponseContent usados pelos endpoints .get() da Management API e compare seus campos com a documentação da API vinculada. Identifique os campos documentados como sempre presentes, torne sua tipagem de resposta não opcional e verifique as anotações atualizadas em endpoints representativos.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 578
- Forks
- 189
- Merge médio
- 15h
- PRs com merge (30d)
- 6
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de auth0/auth0-python
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
auth0/auth0-python#852 ·
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
auth0/auth0-python#856 · 4 comentários · 1 reação ·
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
auth0/auth0-python#789 · 1 comentário · 1 reação ·
Todas as issues de auth0/auth0-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
vllm-project/vllm#61131 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
kubernetes-client/python#2735 ·
Mantenedores costumam responder em até 1 dia
-
desktop help wanted test
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Broken links found in docsAbertadocs pydanty:is-working
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
pydantic/pydantic-ai#10113 ·
Mantenedores costumam responder em até 1 dia
-
Tutorial unit test leaks sample data into tutorial doctestTalvez já em andamento @Gambit-Checkmate assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100