All GetXXXResponseContent types declare all fields as Optional in Management API
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Bắt đầu bằng cách xác định các model GetXXXResponseContent được sử dụng bởi các endpoint .get() của Management API và so sánh các trường của chúng với tài liệu API được liên kết. Xác định các trường được tài liệu ghi nhận là luôn hiện diện, chuyển kiểu response của chúng thành không tùy chọn và xác minh các annotation đã cập nhật trên các endpoint tiêu biểu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 581
- Fork
- 189
- Merge trung bình
- 15 giờ 33 phút
- Pull request đã merge (30 ngày)
- 6
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của auth0/auth0-python
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
auth0/auth0-python#852 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
auth0/auth0-python#856 · 4 bình luận · 1 reaction ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
auth0/auth0-python#789 · 1 bình luận · 1 reaction ·
Tất cả issue của auth0/auth0-python
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
canonical/paas-charm#368 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
tech debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
addition to tracking list Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
StevenBlack/hosts#3256 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
qualcomm/qai-appbuilder#275 ·