Mercurial > prosody-hg
comparison util/jsonschema.lua @ 13872:76582d10bc09
Merge 13.0->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 05 May 2025 17:30:06 +0200 |
| parents | 7f6916088278 eabd38507c1d |
| children | b713da7527d2 |
comparison
equal
deleted
inserted
replaced
| 13866:7f6916088278 | 13872:76582d10bc09 |
|---|---|
| 182 table.insert(errs, mkerr(sloc .. "/anyOf", iloc, "did not match any subschema")) | 182 table.insert(errs, mkerr(sloc .. "/anyOf", iloc, "did not match any subschema")) |
| 183 return false, errs | 183 return false, errs |
| 184 end | 184 end |
| 185 end | 185 end |
| 186 | 186 |
| 187 if schema["not"] then | 187 if schema["not"] ~= nil then |
| 188 if validate(schema["not"], data, root, sloc .. "/not", iloc, errs) then | 188 if validate(schema["not"], data, root, sloc .. "/not", iloc, errs) then |
| 189 table.insert(errs, mkerr(sloc .. "/not", iloc, "did match subschema")) | 189 table.insert(errs, mkerr(sloc .. "/not", iloc, "did match subschema")) |
| 190 return false, errs | 190 return false, errs |
| 191 end | 191 end |
| 192 end | 192 end |
| 193 | 193 |
| 194 if schema["if"] ~= nil then | 194 if schema["if"] ~= nil then |
| 195 if validate(schema["if"], data, root, sloc .. "/if", iloc, errs) then | 195 if validate(schema["if"], data, root, sloc .. "/if", iloc, errs) then |
| 196 if schema["then"] then | 196 if schema["then"] ~= nil then |
| 197 if not validate(schema["then"], data, root, sloc .. "/then", iloc, errs) then | 197 if not validate(schema["then"], data, root, sloc .. "/then", iloc, errs) then |
| 198 table.insert(errs, mkerr(sloc .. "/then", iloc, "did not match subschema")) | 198 table.insert(errs, mkerr(sloc .. "/then", iloc, "did not match subschema")) |
| 199 return false, errs | 199 return false, errs |
| 200 end | 200 end |
| 201 end | 201 end |
| 202 else | 202 else |
| 203 if schema["else"] then | 203 if schema["else"] ~= nil then |
| 204 if not validate(schema["else"], data, root, sloc .. "/else", iloc, errs) then | 204 if not validate(schema["else"], data, root, sloc .. "/else", iloc, errs) then |
| 205 table.insert(errs, mkerr(sloc .. "/else", iloc, "did not match subschema")) | 205 table.insert(errs, mkerr(sloc .. "/else", iloc, "did not match subschema")) |
| 206 return false, errs | 206 return false, errs |
| 207 end | 207 end |
| 208 end | 208 end |
