Changeset

12761:82915c755d90

Merge 0.12->trunk
author Kim Alvefur <zash@zash.se>
date Sun, 09 Oct 2022 15:50:25 +0200
parents 12755:a09dacf660d2 (current diff) 12760:ce1a0f9bf25a (diff)
children 12762:79b89f382290
files
diffstat 2 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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",
--- 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