Validation error with nested oneOf

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

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

評価

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

調査の方向性

Start by reproducing the validation failure with the schema and document in the issue, then trace the nested oneOf and additionalProperties handling in the validator. Done means the supplied nested array is evaluated according to the matching oneOf branch and the validator no longer reports that the value matches none.

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

説明

We are developing a tool to apply differential test on json-schema libraries.

We found a subtle error happening only with the LUA's jsonschema library.

We used the following schema:

{
  "type": "object",
  "properties": {
    "resources": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "params": {
                "type": "object",
                "additionalProperties": {
                  "oneOf": [
                    { "type": "array" },
                    { "type": "object" },
                    { "type": "string" }
                  ]
                }
              }
            }
          }
        ]
      }
    }
  }
}

And the following document:

{
  "resources": {
    "myBicepWithInvalidParams": {
      "params": {
        "param1": []
      }
    }
  }
}

With these, it was generated the following error message:

Invalid doc for schema aspire property "resources"
validation failed: failed to validate additional
property myBicepWithInvalidParams: value should match
only one schema, but matches none
主要言語
Lua
スター
136
フォーク
29
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

api7/jsonschema のほかの issue

api7/jsonschema の issue をすべて見る

似ている issue

Lua の issue をもっと見る

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

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