Idea: warn on unsupported keywords (e.g. "const" in draft-04 schemas)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
validate の例と DraftXValidator の実装から始めます。各 draft がスキーマキーワードをどのように扱うかを確認し、一覧にある新しいキーワードまたは名前が変更されたキーワードに対する警告の動作を定義します。その際、未知の format 値に対する既存の処理は維持します。影響を受ける draft validator で警告を確認します。
索引モデルが issue の本文から書いたものです。
説明
I just spent a few minutes digging into a test failure which boiled down to the following:
from jsonschema import validate
schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"const": None,
}
validate("literally anything validates", schema)
which is of course because the const keyword was added in draft-06! Since I've seen analogous problems several times now, I wonder if we should make the earlier DraftXValidators emit a warning when they see a keyword which was added in a later draft. That would be:
- <= draft04, warn on
propertyNames,contains, andconst(added in draft06) - <= draft06, warn on
if,then, andelse(added in draft07) - In draft07, the
mediakeyword was replaced withcontentMediaTypeandcontentEncoding, so warnings on both sides could help - <= draft07... there are lots
I've ignored the string format values, because they explictly permit ignoring unknown values and it's reasonable to think that users might have backported a check - whereas the too-new keywords are almost certainly a programmer error.
- 主要言語
- Python
- スター
- 5k
- フォーク
- 671
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-jsonschema/jsonschema のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
python-jsonschema/jsonschema#1538 ·
-
Needs Test Upstream
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
python-jsonschema/jsonschema#1511 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
python-jsonschema/jsonschema#1558 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
python-jsonschema/jsonschema#1547 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
python-jsonschema/jsonschema#1536 · コメント 1 件 ·
python-jsonschema/jsonschema の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
instance instance add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
searxng/searx-instances#939 · コメント 1 件 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100