Software /
code /
prosody
Changeset
11447:7ad137fe665b
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 09 Mar 2021 14:22:33 +0100 |
parents | 11446:58c534bac798 |
children | 11448:1d84b54ba0d7 |
files | teal-src/util/jsonschema.tl util/jsonschema.lua |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/teal-src/util/jsonschema.tl Tue Mar 09 02:43:50 2021 +0100 +++ b/teal-src/util/jsonschema.tl Tue Mar 09 14:22:33 2021 +0100 @@ -200,8 +200,8 @@ 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
--- a/util/jsonschema.lua Tue Mar 09 02:43:50 2021 +0100 +++ b/util/jsonschema.lua Tue Mar 09 14:22:33 2021 +0100 @@ -118,8 +118,8 @@ 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