Software /
code /
prosody
Comparison
teal-src/util/jsonschema.tl @ 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 |
parent | 11446:58c534bac798 |
child | 11448:1d84b54ba0d7 |
comparison
equal
deleted
inserted
replaced
11446:58c534bac798 | 11447:7ad137fe665b |
---|---|
198 | 198 |
199 if schema.const ~= nil and schema.const ~= data then | 199 if schema.const ~= nil and schema.const ~= data then |
200 return false | 200 return false |
201 end | 201 end |
202 | 202 |
203 if schema.enum ~= nil then | 203 if schema["enum"] ~= nil then |
204 for _, v in ipairs(schema.enum) do | 204 for _, v in ipairs(schema["enum"]) do |
205 if v == data then | 205 if v == data then |
206 return true | 206 return true |
207 end | 207 end |
208 end | 208 end |
209 return false | 209 return false |