Primitive and enum collections contain None despite non-nullable element annotations
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 31
- フォーク
- 48
- 平均マージ
- 16時間 36分
- マージ済み PR(30日)
- 73
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/kiota-python のほかの issue
-
Backing store enumeration returns internal tracking tuples instead of stored lists対応中かも @pradeep-ramola が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/kiota-python#938 ·
メンテナーはふだん 1 日以内に返信
-
JSON numeric getters accept booleans as integers and floats対応中かも @pradeep-ramola が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/kiota-python#935 ·
メンテナーはふだん 1 日以内に返信
-
ensure 304 response code does not throw再び着手できるかも @nightcityblade が 92 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンhelp wanted type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/kiota-python#477 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
microsoft/kiota-python#901 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
microsoft/kiota-python#898 ·
メンテナーはふだん 1 日以内に返信
microsoft/kiota-python の issue をすべて見る
似ている issue
-
backend: claude chore dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
briandconnelly/amicus#606 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
semantica-agi/semantica#2320 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
vllm-project/vllm-omni#11465 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
jxxghp/MoviePilot#7699 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
vllm-project/vllm-ascend#24010 ·
メンテナーはふだん 1 日以内に返信