jsonschema
jsonschema copied to clipboard
Pure Lua JSON schema validator for Lua/LuaJIT
In jsonschema we have `not` keyword, but how can I use it in Lua? For example, We have jsonschema: ``` "dependencies": { "field_2": { "not": { "required": ["field_3"] } },...
Example, worked in 0.8: ```lua jsonschema.generate_validator({ type = "object", properties = { ["$id"] = { type = "string" } } }) ``` Now (0.9.5) fails with: ``` .../lib/openresty/luajit/share/lua/5.1/jsonschema/store.lua:199: attempt to...
In the following example, we combine "$ref" with another key, here "properties". **Expected result:** Validation returns "false" as modelVersion.major is > 2. **Observed result:** Validation returns "true" ```lua local schema...
I found this code in jsonschema.lua ``` if schema.required and #schema.required == 0 then -- return false if the input data is not empty ctx:stmt(sformat('if %s ~= 1 then', datakind))...
Currently it always returns true. I cannot help out with this right now, this issue is to document the shortcoming so other users are aware.
In the following example, "default" fields have wrong type. Yet, validator gives a positive result. ```lua local schema = [[ { "$schema": "https://json-schema.org/draft/2019-09/schema#", "type": "object", "$defs": { "parameter": { "type":...
wrong case: ``` local schema = { type = "object", oneOf = { { title = "work with consumer object", properties = { access_key = {type = "string", minLength =...
* https://github.com/api7/jsonschema/commit/32e8c1f0a9910ebb59768d8e1f19a0af755cd8bd