Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Idea: warn on unsupported keywords (e.g. "const" in draft-04 schemas)

オープン
#778 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

validate の例と DraftXValidator の実装から始めます。各 draft がスキーマキーワードをどのように扱うかを確認し、一覧にある新しいキーワードまたは名前が変更されたキーワードに対する警告の動作を定義します。その際、未知の format 値に対する既存の処理は維持します。影響を受ける draft validator で警告を確認します。

索引モデルが issue の本文から書いたものです。

説明

Dialects v2 Enhancement

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, and const (added in draft06)
  • <= draft06, warn on if, then, and else (added in draft07)
  • In draft07, the media keyword was replaced with contentMediaType and contentEncoding, 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-jsonschema/jsonschema のほかの issue

python-jsonschema/jsonschema の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。