Software /
code /
prosody
Comparison
util/jsonschema.lua @ 13164:1aa83a5667f9
util.jsonschema: Remove wrapper function
This was to silence some Teal warning that seems to have gone away.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 17 Jun 2023 17:19:40 +0200 |
parent | 13163:f43d04653bcf |
comparison
equal
deleted
inserted
replaced
13163:f43d04653bcf | 13164:1aa83a5667f9 |
---|---|
41 else | 41 else |
42 return type(data) == schema | 42 return type(data) == schema |
43 end | 43 end |
44 end | 44 end |
45 | 45 |
46 local complex_validate | |
47 | |
48 local function validate(schema, data, root) | 46 local function validate(schema, data, root) |
49 if type(schema) == "boolean" then | 47 if type(schema) == "boolean" then |
50 return schema | 48 return schema |
51 else | 49 end |
52 return complex_validate(schema, data, root) | |
53 end | |
54 end | |
55 | |
56 function complex_validate(schema, data, root) | |
57 | 50 |
58 if root == nil then | 51 if root == nil then |
59 root = schema | 52 root = schema |
60 end | 53 end |
61 | 54 |