Need of recursive properties check in validation

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

Start in validation/keywords.py at SchemaValidator and trace how nested schemas, allOf, and properties are currently validated. Done means recursive properties in nested schemas are detected, including schemas nested through allOf, with validation behavior covering the reported API case.

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

説明

Some APIs contain nested schemas, and the current version of 0.7.1 openapi-spec-validator is unable catch the recursive properties. Below is an example of what can be achieved with a little tweak in the class SchemaValidator validation/keywords.py.

 nested_properties = []
        if "allOf" in schema:
            all_of = schema / "allOf"
            while True:
              for inner_schema in all_of:
                  yield from self(
                      inner_schema,
                      require_properties=False,
                  )
                  if "properties" not in inner_schema:
                      continue
                  inner_schema_props = inner_schema / "properties"
                  inner_schema_props_keys = inner_schema_props.keys()
                  nested_properties += list(inner_schema_props_keys)
              if "allOf" not in inner_schema:
                 break
              all_of = inner_schema / "allOf"
主要言語
Python
スター
409
フォーク
73
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

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

python-openapi/openapi-spec-validator のほかの issue

python-openapi/openapi-spec-validator の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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