diff options
-rw-r--r-- | teal-src/util/jsonschema.tl | 4 | ||||
-rw-r--r-- | util/jsonschema.lua | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/teal-src/util/jsonschema.tl b/teal-src/util/jsonschema.tl index 9600fee4..3df17477 100644 --- a/teal-src/util/jsonschema.tl +++ b/teal-src/util/jsonschema.tl @@ -200,8 +200,8 @@ local function validate(schema : schema_t | type_e | boolean, data : any) : bool return false end - if schema.enum ~= nil then - for _, v in ipairs(schema.enum) do + if schema["enum"] ~= nil then + for _, v in ipairs(schema["enum"]) do if v == data then return true end diff --git a/util/jsonschema.lua b/util/jsonschema.lua index 0723a45e..ed8c0ccc 100644 --- a/util/jsonschema.lua +++ b/util/jsonschema.lua @@ -118,8 +118,8 @@ local function validate(schema, data) return false end - if schema.enum ~= nil then - for _, v in ipairs(schema.enum) do + if schema["enum"] ~= nil then + for _, v in ipairs(schema["enum"]) do if v == data then return true end |