-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Labels
bugThis points to a verified bug in the codeThis points to a verified bug in the code
Description
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] = NoneHowever 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugThis points to a verified bug in the codeThis points to a verified bug in the code