Primitive and enum collections contain None despite non-nullable element annotations
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 12/100
Hướng nghiên cứu
Start with get_collection_of_primitive_values and get_collection_of_enum_values in packages/serialization/json/kiota_serialization_json/json_parse_node.py, plus the nullable converters below them, and compare them with the public contracts in packages/abstractions/kiota_abstractions/serialization/parse_node.py. The issue asks maintainers to choose between widening the annotations and rejecting nulls, so agree on that direction before editing. Done means a decision is recorded and tests cover nulls, wrong shapes, temporal failures and array-versus-CSV enum behaviour.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Optional[list[T]] permits an absent collection, not None elements. JSON primitive and enum collection readers retain nullable conversion results, while generated properties expose non-nullable elements.
Reproduction
import json
from enum import Enum
from kiota_serialization_json.json_parse_node import JsonParseNode
JsonParseNode(json.loads('["a", null, 42]')).get_collection_of_primitive_values(str)
# ["a", None, None], despite Optional[list[str]]
class Colour(Enum):
Red = "red"
JsonParseNode(json.loads('["red", null, "unknown"]')).get_collection_of_enum_values(Colour)
# [Colour.Red, None, None]
These reproductions are source-derived. CSV enum parsing filters unsuccessful results, unlike enum array parsing. Some malformed temporal/UUID values throw while other conversions return None. Model factories normally create empty models for JSON null; they are not included in this confirmed mismatch.
Source
- Public collection contracts
- Primitive mapping
- Enum mapping
- Nullable converters
- Typed model and collection assignment
Expected resolution and breaking impact
Either reflect nullable elements in abstractions, implementations and generated models, or reject null/unsuccessful conversions when promising non-nullable elements. Widening annotations is source-breaking; throwing changes behavior. Avoid casts that hide the mismatch or silent filtering of position-sensitive arrays. Cover nulls, wrong primitive shapes, temporal conversion failures and array-versus-CSV enum behavior. Coordinate runtime and generator releases.
Related cross-language audit: microsoft/kiota#8377.
- Ngôn ngữ chính
- Python
- Star
- 31
- Fork
- 48
- Merge trung bình
- 16 giờ 36 phút
- Pull request đã merge (30 ngày)
- 73
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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 microsoft/kiota-python
-
Backing store enumeration returns internal tracking tuples instead of stored listsCó thể đã có người làm @pradeep-ramola đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microsoft/kiota-python#938 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
JSON numeric getters accept booleans as integers and floatsCó thể đã có người làm @pradeep-ramola đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/kiota-python#935 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ensure 304 response code does not throwCó thể làm lại được @nightcityblade đã nhận 92 ngày trước và không có pull request nào đang mở. Đang mởhelp wanted type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/kiota-python#477 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
microsoft/kiota-python#901 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
microsoft/kiota-python#898 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/kiota-python
Issue tương tự
-
backend: claude chore dependencies
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
briandconnelly/amicus#606 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
semantica-agi/semantica#2320 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
vllm-project/vllm-omni#11465 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jxxghp/MoviePilot#7699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
vllm-project/vllm-ascend#24010 ·
Maintainer thường phản hồi trong vòng 1 ngày