in some cases, the verification result is wrong
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Lua
- Estrellas
- 136
- Forks
- 29
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de api7/jsonschema
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
api7/jsonschema#95 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
api7/jsonschema#105 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
api7/jsonschema#93 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
api7/jsonschema#92 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 42/100
api7/jsonschema#91 ·
Todos los issues de api7/jsonschema
Issues similares
-
P-47D: GEAR_LVR always reads 1Posiblemente ocupada @cbass2404 la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
DCS-Skunkworks/dcs-bios#1932 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
JohnnyMorganz/luau-lsp#1673 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
cortex-command-community/Cortex-Command-Community-Project#315 ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
folke/snacks.nvim#2975 ·