Support recursive references
まだ誰も着手していません。
評価
調査の方向性
Start by reading the reference resolution and schema generation entry points named in the issue: resolve_all_refs(), canonicalish(), and from_schema(). Explore how they handle non-recursive references and review the suggested use of Hypothesis's st.deferred() strategy. Done means recursive and mutually recursive references generate valid data, while non-recursive references retain useful introspection and avoid unnecessary deferred strategies.
索引モデルが issue の本文から書いたものです。
説明
Take for example the following schema:
{
"person": {
"type": "object",
"properties": {
"name": {"type": "string"},
"parents": {
"type": "array",
"maxItems": 2,
"items": {"$ref": "#/person"}
}
}
},
"$ref": "#/person"
}
So we need to generate a person, who has 0-2 parents, each of whom is also a person. More complicated situations with several mutually-recursive objects are also possible, of course. Currently such cases will fail a RecursionError as we make no attempt to handle them!
Conceptually these are all easy enough to handle with the st.deferred() strategy... which is the extent of the good news. Some complications:
- We want to avoid using
st.deferred()when we don't actually need to, as it makes introspection (including e.g. error messages!) much less helpful, and adds some performance overhead (small but rarely needed). resolve_all_refs()can still resolve all non-recursive references in place, but will need to track which references have been traversed to avoid cycles.canonicalish()can still discard all non-functional keys, so long as it tracks which keys are reference targets. We can also re-write these to a standard location such as#/definitions/*.from_schema()can then switch into "deferred mode" if and only if there is a#/definitionspart of the schema after canonicalising.
This is all basically managable, but it's also going to be a lot of work that I just don't have capacity to do for free. Pull requests and/or funding welcome, but otherwise expect this issue to stay open.
- 主要言語
- Python
- スター
- 281
- フォーク
- 35
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-jsonschema/hypothesis-jsonschema のほかの issue
-
Missing test files in Pypi release対応中かも @blouirts123 が 49 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
Shouldn't PKG-INFO Homepage point to https://github.com/python-jsonschema/hypothesis-jsonschema ?オープン
難易度 1/5 1時間未満 初心者へのやさしさ 58/100
python-jsonschema/hypothesis-jsonschema#114 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
python-jsonschema/hypothesis-jsonschema#113 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
python-jsonschema/hypothesis-jsonschema#104 · リアクション 3 件 ·
python-jsonschema/hypothesis-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 日以内に返信