aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-09 14:22:33 +0100
committerKim Alvefur <zash@zash.se>2021-03-09 14:22:33 +0100
commit44edd47ca85307e1e4886aea59197c2ccec6f47c (patch)
tree8b1f19a43457bda3e8cae056b6affaeb0737cf1a
parent1317e78fbb50d585d3f0aa55262690db8c096026 (diff)
downloadprosody-44edd47ca85307e1e4886aea59197c2ccec6f47c.tar.gz
prosody-44edd47ca85307e1e4886aea59197c2ccec6f47c.zip
util.jsonschema: Syntax tweak to not upset syntax highlighting
That whole condition stanza was shown as angry red, I think it's something with 'enum' being a key word in Teal.
-rw-r--r--teal-src/util/jsonschema.tl4
-rw-r--r--util/jsonschema.lua4
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