# HG changeset patch # User Kim Alvefur # Date 1665323425 -7200 # Node ID 82915c755d90a8be5381f2ee197d1a8a5adc6022 # Parent a09dacf660d275b98590e57a6f01c8f7a8eb70c7# Parent ce1a0f9bf25ab7b8904e42591e8930b2408294b5 Merge 0.12->trunk diff -r a09dacf660d2 -r 82915c755d90 spec/util_jsonschema_spec.lua --- a/spec/util_jsonschema_spec.lua Sat Oct 08 23:55:22 2022 +0100 +++ b/spec/util_jsonschema_spec.lua Sun Oct 09 15:50:25 2022 +0200 @@ -8,10 +8,6 @@ -- Tests to skip and short reason why (NYI = not yet implemented) local skip = { - ["ref.json:0:3"] = "NYI additionalProperties"; - ["ref.json:3:2"] = "FIXME investigate, util.jsonpath issue?", - ["ref.json:6:1"] = "NYI", - ["required.json:0:2"] = "distinguishing objects from arrays", ["additionalProperties.json:0:2"] = "distinguishing objects from arrays", ["additionalProperties.json:0:5"] = "NYI", ["additionalProperties.json:1:0"] = "NYI", @@ -40,16 +36,26 @@ ["patternProperties.json"] = "NYI", ["properties.json:1:2"] = "NYI", ["properties.json:1:3"] = "NYI", + ["ref.json:0:3"] = "NYI additionalProperties", + ["ref.json:11"] = "NYI", + ["ref.json:12:1"] = "FIXME", + ["ref.json:13"] = "NYI", ["ref.json:14"] = "NYI", ["ref.json:15"] = "NYI", ["ref.json:16"] = "NYI", ["ref.json:17"] = "NYI", ["ref.json:18"] = "NYI", - ["ref.json:13"] = "NYI", ["ref.json:19"] = "NYI", - ["ref.json:11"] = "NYI", - ["ref.json:12:1"] = "FIXME", + ["ref.json:26"] = "NYI", + ["ref.json:27"] = "NYI", + ["ref.json:28"] = "NYI", + ["ref.json:3:2"] = "FIXME investigate, util.jsonpath issue?", + ["required.json:4"] = "JavaScript specific and distinguishing objects from arrays", + ["ref.json:6:1"] = "NYI", + ["ref.json:20"] = "NYI", + ["ref.json:25"] = "NYI", ["refRemote.json"] = "DEFINITELY NYI", + ["required.json:0:2"] = "distinguishing objects from arrays", ["type.json:3:4"] = "distinguishing objects from arrays", ["type.json:3:6"] = "null is weird", ["type.json:4:3"] = "distinguishing objects from arrays", diff -r a09dacf660d2 -r 82915c755d90 util/jsonschema.lua --- a/util/jsonschema.lua Sat Oct 08 23:55:22 2022 +0100 +++ b/util/jsonschema.lua Sun Oct 09 15:50:25 2022 +0200 @@ -1,7 +1,7 @@ -- This file is generated from teal-src/util/jsonschema.lua -local m_type = math.type or function (n) - return n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float"; +local m_type = function(n) + return type(n) == "number" and n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float"; end; local json = require("util.json") local null = json.null; @@ -81,7 +81,7 @@ if type(data) == "table" then for i in pairs(data) do - if not (math.type(i) == "integer") then + if not (m_type(i) == "integer") then return false end end