Designating a dialect for custom metaschemas in 4.18

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

メンテナーはふだん 6 日以内に返信

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

評価

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

調査の方向性

リンクされた行にある jsonschema/validators.py の create メソッドから始め、次にリンクされた行にある referencing/jsonschema.py の dialect 登録コードを読んでください。カスタム metaschema で draft 4 を選択すべきか、新しい dialect を登録すべきかを判断するため、議論を確認してください。カスタム metaschema の仕様を選択するための、合意済みでサポートされた方法が決まれば完了です。

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

説明

Bug

I'm working with a custom metaschema that is a superset of draft 4, is there/will there be a way to select the draft 4 dialect when creating a Validator class? Currently the create method is choosing the opaque dialect when it fails to recognize our metaschema's id:

https://github.com/python-jsonschema/jsonschema/blob/v4.18.0a1/jsonschema/validators.py#L187

and the referencing package doesn't appear to offer a sanctioned method for registering a new dialect id:

https://github.com/python-jsonschema/referencing/blob/v0.24.4/referencing/jsonschema.py#L544-L556

Is there another way to accomplish this that I'm missing? And if not, are you open to adding something like a default_specification argument to the create method?

By the way, thanks a lot for providing an alpha release, it's super helpful to be able to work through our issues ahead of time.

主要言語
Python
スター
5k
フォーク
741
平均マージ
4日 17時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

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

python-jsonschema/jsonschema のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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