Software /
code /
prosody
Comparison
util/jsonschema.lua @ 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 |
---|---|
116 | 116 |
117 if schema.const ~= nil and schema.const ~= data then | 117 if schema.const ~= nil and schema.const ~= data then |
118 return false | 118 return false |
119 end | 119 end |
120 | 120 |
121 if schema.enum ~= nil then | 121 if schema["enum"] ~= nil then |
122 for _, v in ipairs(schema.enum) do | 122 for _, v in ipairs(schema["enum"]) do |
123 if v == data then | 123 if v == data then |
124 return true | 124 return true |
125 end | 125 end |
126 end | 126 end |
127 return false | 127 return false |