All GetXXXResponseContent types declare all fields as Optional in Management API
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start by locating the GetXXXResponseContent models used by Management API .get() endpoints and compare their fields with the linked API documentation. Identify fields documented as always present, make their response typing non-optional, and verify the updated annotations across representative endpoints.
Written by the indexing model from the issue text.
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] = 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
- Dominant language
- Python
- Stars
- 581
- Forks
- 189
- Avg merge
- 15h 33m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from auth0/auth0-python
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
auth0/auth0-python#852 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
auth0/auth0-python#856 · 4 comments · 1 reaction ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
auth0/auth0-python#789 · 1 comment · 1 reaction ·
All issues in auth0/auth0-python
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·