util/jsonschema.lua
changeset 13168 1aa83a5667f9
parent 13167 f43d04653bcf
child 13389 72d7830505f0
equal deleted inserted replaced
13167:f43d04653bcf 13168: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