Issue with unevaluatedProperties and allOf and arrays
メンテナーはふだん 6 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
リポジトリのファイル、テスト、エントリポイントについては何も言及されていません。まず、提供されたスキーマとインスタンスデータを validator で実行し、次に allOf 配列の各要素内で unevaluatedProperties がどのように動作するかを切り分けてください。完了条件は、報告された Nestedppty の拒否が想定どおりなのか、validator の不具合なのかを特定することです。不具合である場合は、焦点を絞った回帰テストを追加してください。
索引モデルが issue の本文から書いたものです。
説明
I need to have a schema allowing extra fields only under one specific node (ExtensionProperties).
It works well using "additionalProperties": false with simple schemas:
{
"$schema": "https://json-schema.org/draft/2019-09/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"rootppty": {
"type": "string"
},
"ExtensionProperties": {
"type": "object"
}
}
}
This data is ok
{
"rootppty": "ad",
"ExtensionProperties": {
"whatever": "you want"
}
}
and this one fails validation as expected
{
"rootppty": "ok",
"other": "fail",
"ExtensionProperties": {
"whatever": "you want"
}
}
But when I have some allOf, I need to use "unevaluatedProperties": false as explained in the documentation
It works well with simple schemas
{
"$schema": "https://json-schema.org/draft/2019-09/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"rootppty": {
"type": "string"
},
"data": {
"unevaluatedProperties": false,
"allOf": [{
"type": "object",
"title": "IndividualProperties",
"properties": {
"Nestedppty": {
"type": "string"
}
}
}
]
},
"ExtensionProperties": {
"type": "object"
}
}
}
This data fails the validation as expected (on rootppty2 and Nestedppty2)
{
"rootppty": "ok",
"rootppty2": "fail",
"data": {
"Nestedppty": "ok",
"Nestedppty2": "fail"
},
"ExtensionProperties": {
"whatever": "you want"
}
}
But when I am adding array in the allOf part I am facing issues
This schema does not fail validation on additional fields in the array
{
"$schema": "https://json-schema.org/draft/2019-09/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"rootppty": {
"type": "string"
},
"data": {
"unevaluatedProperties": false,
"allOf": [{
"type": "object",
"title": "IndividualProperties",
"properties": {
"Nestedppty": {
"type": "string"
},
"Nestedarray": {
"type": "array",
"items": {
"unevaluatedProperties": false,
"type": "object",
"properties": {
"additionalProperties": false,
"nestedarrayInternalpty": {
"type": "string"
}
}
}
}
}
}
]
},
"ExtensionProperties": {
"type": "object"
}
}
}
for example this data should fail validation on nestedarrayInternalpty2
{
"rootppty": "ok",
"data": {
"Nestedppty": "ok",
"Nestedarray": [
{"nestedarrayInternalpty": "ok"},
{"nestedarrayInternalpty2": "should fail"}
]
},
"ExtensionProperties": {
"whatever": "you want"
}
}
but it fails also on Nestedppty, which should be ok
Am I doing something wrong or is there an issue when several "unevaluatedProperties": false are nested ?
- 主要言語
- Python
- スター
- 5k
- フォーク
- 741
- 平均マージ
- 4日 17時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-jsonschema/jsonschema のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
python-jsonschema/jsonschema#1610 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
python-jsonschema/jsonschema#1588 · コメント 2 件 ·
メンテナーはふだん 6 日以内に返信
-
Iterator error contexts lose parent links and absolute paths再び着手できるかも @DawnofGenX が 59 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
python-jsonschema/jsonschema#1584 · コメント 3 件 ·
メンテナーはふだん 6 日以内に返信
-
regex format checker crashes with RecursionError on deeply nested patterns対応中かも @DawnofGenX が 59 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
python-jsonschema/jsonschema#1538 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
-
is_duration raises an uncaught decimal.Overflow on a duration with a large exponent再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンNeeds Test Upstream
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
python-jsonschema/jsonschema#1511 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
python-jsonschema/jsonschema の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
web-push-libs/pywebpush#216 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AgriciDaniel/claude-seo#572 ·
メンテナーはふだん 5 日以内に返信
-
area:print-dispatch
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
area: docs domain: technical-writing good first issue type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Deepak3699/Ai_Mentor#919 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信