in some cases, the verification result is wrong
まだ誰も着手していません。
評価
調査の方向性
Start with the provided Lua reproducer and the jsonschema.generate_validator entry point, then compare validation when the oneOf alternatives are ordered differently. The issue is done when the empty configuration and the {"clock_skew": 300} configuration produce consistent, correct verification results regardless of oneOf item order.
索引モデルが issue の本文から書いたものです。
説明
wrong case:
local schema = {
type = "object",
oneOf = {
{
title = "work with consumer object",
properties = {
access_key = {type = "string", minLength = 1, maxLength = 256},
secret_key = {type = "string", minLength = 1, maxLength = 256},
algorithm = {
type = "string",
enum = {"hmac-sha1", "hmac-sha256", "hmac-sha512"},
default = "hmac-sha256"
},
clock_skew = {
type = "integer",
default = 300
},
signed_headers = {
type = "array",
items = {
type = "string",
minLength = 1,
maxLength = 20,
}
},
},
required = {"access_key", "secret_key"},
additionalProperties = false,
},
},
{
title = "work with route or service object",
properties = {},
additionalProperties = false,
}
}
local validator = jsonschema.generate_validator(schema)
local conf = {}
local ok = validator(conf)
if not ok then
ngx.say("value checking failure")
return
end
If I change the order of items of the schema object , it will be ok:
local schema = {
type = "object",
oneOf = {
{
title = "work with route or service object",
properties = {},
additionalProperties = false,
},
{
title = "work with consumer object",
properties = {
access_key = {type = "string", minLength = 1, maxLength = 256},
secret_key = {type = "string", minLength = 1, maxLength = 256},
algorithm = {
type = "string",
enum = {"hmac-sha1", "hmac-sha256", "hmac-sha512"},
default = "hmac-sha256"
},
clock_skew = {
type = "integer",
default = 300
},
signed_headers = {
type = "array",
items = {
type = "string",
minLength = 1,
maxLength = 20,
}
},
},
required = {"access_key", "secret_key"},
additionalProperties = false,
},
},
}
local validator = jsonschema.generate_validator(schema)
local conf = {}
local ok = validator(conf)
if not ok then
ngx.say("value checking failure")
return
end
In the wrong case, conf had been change to {"clock_skew": 300}.
I think this is the reason.
- 主要言語
- Lua
- スター
- 136
- フォーク
- 29
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
api7/jsonschema のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
api7/jsonschema#95 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
api7/jsonschema#105 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
api7/jsonschema#93 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
api7/jsonschema#92 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 42/100
api7/jsonschema#91 ·
api7/jsonschema の issue をすべて見る
似ている issue
-
test-net.lua fails on linux対応中かも @PatrickDahlin が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
agent-review-finding
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
codymikol/multiverse.nvim#393 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
[alt:V] discontinuedオープン
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
pterodactyl/game-eggs#665 ·
メンテナーはふだん 1 日以内に返信