You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a bug when using boolean fields in my JSON Schema. My partial JSON Schema which I use to detect the error was the following:
..."bool_param":{
"oneOf":[{
"type":"boolean"
},{
"enum":["external"]
}],
"default":true,
"description":"Description of bool_param. Set as 'external' if the value is not yet known and thus will be set externally at runtime (only once) depending on e.g. the outcome of a previous action or the outcome of another module."
},
...
When setting it to true or false, I got the following error when validating the schema:
lua: /usr/local/share/lua/5.1/jsonschema.lua:701: bad argument #4 to 'sformat' (string expected, got boolean)
stack traceback:
[C]: infunction'sformat'
/usr/local/share/lua/5.1/jsonschema.lua:701: infunction'generate_validator'
/usr/local/share/lua/5.1/jsonschema.lua:173: infunction'validator'
/usr/local/share/lua/5.1/jsonschema.lua:678: infunction'generate_validator'
/usr/local/share/lua/5.1/jsonschema.lua:173: infunction'validator'
/usr/local/share/lua/5.1/jsonschema.lua:1184: infunction'generate_main_validator_ctx'
/usr/local/share/lua/5.1/jsonschema.lua:1201: infunction'generate_validator'
./task_requirements.lua:501: infunction'load_json_table'
example.lua:35: in main chunk
[C]: ?
The bug was (apparently) easily fixed by changing line 701 of the jsonschema.lua from:
I found a bug when using boolean fields in my JSON Schema. My partial JSON Schema which I use to detect the error was the following:
When setting it to true or false, I got the following error when validating the schema:
The bug was (apparently) easily fixed by changing line 701 of the jsonschema.lua from:
to
I guess this happens because lua does not convert booleans to strings automatically.
The text was updated successfully, but these errors were encountered: