From eb551645d5ba1caaf9c6dddbb28447806d7ac452 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 5 Nov 2025 12:52:31 -0400 Subject: [PATCH] Require JSON Schema `bignum` support for arbitrary sized numbers Signed-off-by: Juan Cruz Viotti --- schemas/w3c/xmlschema/2001/decimal.json | 15 +- schemas/w3c/xmlschema/2001/integer.json | 16 +- .../w3c/xmlschema/2001/negative-integer.json | 14 +- .../xmlschema/2001/non-negative-integer.json | 15 +- .../xmlschema/2001/non-positive-integer.json | 15 +- .../w3c/xmlschema/2001/positive-integer.json | 14 +- schemas/w3c/xmlschema/2001/unsigned-long.json | 72 +--- .../xbrl/instance/2003/decimal-item-type.json | 2 +- .../instance/2003/fraction-item-type.json | 10 +- .../xbrl/instance/2003/integer-item-type.json | 2 +- .../instance/2003/monetary-item-type.json | 6 +- .../2003/negative-integer-item-type.json | 2 +- .../2003/non-negative-integer-item-type.json | 2 +- .../2003/non-positive-integer-item-type.json | 2 +- .../2003/positive-integer-item-type.json | 2 +- .../xbrl/instance/2003/pure-item-type.json | 2 +- .../xbrl/instance/2003/shares-item-type.json | 2 +- .../2003/unsigned-long-item-type.json | 2 +- test/w3c/xmlschema/2001/decimal.test.json | 307 +++--------------- test/w3c/xmlschema/2001/integer.test.json | 74 ++--- .../xmlschema/2001/negative-integer.test.json | 50 ++- .../2001/non-negative-integer.test.json | 46 +-- .../2001/non-positive-integer.test.json | 46 +-- .../xmlschema/2001/positive-integer.test.json | 49 ++- .../xmlschema/2001/unsigned-long.test.json | 144 ++------ .../instance/2003/decimal-item-type.test.json | 19 +- .../2003/fraction-item-type.test.json | 72 ++-- .../instance/2003/integer-item-type.test.json | 24 +- .../2003/monetary-item-type.test.json | 32 +- .../2003/negative-integer-item-type.test.json | 21 +- .../non-negative-integer-item-type.test.json | 19 +- .../non-positive-integer-item-type.test.json | 19 +- .../2003/positive-integer-item-type.test.json | 21 +- .../instance/2003/pure-item-type.test.json | 19 +- .../instance/2003/shares-item-type.test.json | 19 +- .../2003/unsigned-long-item-type.test.json | 19 +- 36 files changed, 364 insertions(+), 831 deletions(-) diff --git a/schemas/w3c/xmlschema/2001/decimal.json b/schemas/w3c/xmlschema/2001/decimal.json index 699906ec..99db0399 100644 --- a/schemas/w3c/xmlschema/2001/decimal.json +++ b/schemas/w3c/xmlschema/2001/decimal.json @@ -2,18 +2,9 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "W3C XML Schema decimal", "description": "The decimal datatype represents arbitrary precision decimal numbers (§3.2.3)", - "$comment": "XML Schema requires minimally conforming processors to support decimal numbers with a minimum of 18 decimal digits (totalDigits). JSON's number type (IEEE 754 double-precision) provides only 15-17 significant decimal digits, which does not meet this minimum requirement. This schema uses string representation to maintain XML Schema conformance", - "examples": [ - "-1.23", - "12678967.543233", - "+100000.00", - "210", - "0", - "-0", - "3.14159265358979323846" - ], + "$comment": "XML Schema requires minimally conforming processors to support decimal numbers with a minimum of 18 decimal digits (totalDigits). JSON's number type (IEEE 754 double-precision) provides only 15-17 significant decimal digits. To properly validate arbitrary precision decimals, use a JSON Schema evaluator that supports arbitrary precision number handling", + "examples": [ -1.23, 12679000.0, 100000.0, 210, 0, 3.14159 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.w3.org/TR/xmlschema-2/#decimal" ], - "type": "string", - "pattern": "^[+-]?([0-9]+\\.[0-9]+|[0-9]+)$" + "type": "number" } diff --git a/schemas/w3c/xmlschema/2001/integer.json b/schemas/w3c/xmlschema/2001/integer.json index cb3fb332..2309c2cf 100644 --- a/schemas/w3c/xmlschema/2001/integer.json +++ b/schemas/w3c/xmlschema/2001/integer.json @@ -2,19 +2,9 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "W3C XML Schema integer", "description": "Represents arbitrary-sized integers derived from decimal (§3.3.13)", - "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", - "examples": [ - "0", - "1", - "-1", - "42", - "-273", - "12678967543233", - "-9999999999999999", - "999999999999999999999999999999" - ], + "$comment": "XML Schema supports arbitrary precision integers. JSON's number type is limited to the safe integer range (±2^53-1) per IEEE 754. To properly validate arbitrary precision integers, use a JSON Schema evaluator that supports arbitrary precision integer handling", + "examples": [ 0, 1, -1, 42, -273, 12678967543233, -9999999999999999 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.w3.org/TR/xmlschema-2/#integer" ], - "type": "string", - "pattern": "^[+-]?(0|[1-9][0-9]*)$" + "type": "integer" } diff --git a/schemas/w3c/xmlschema/2001/negative-integer.json b/schemas/w3c/xmlschema/2001/negative-integer.json index cd2c0f40..227482a1 100644 --- a/schemas/w3c/xmlschema/2001/negative-integer.json +++ b/schemas/w3c/xmlschema/2001/negative-integer.json @@ -2,16 +2,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "W3C XML Schema negativeInteger", "description": "Represents strictly negative integers (§3.3.15)", - "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", - "examples": [ - "-1", - "-42", - "-1000", - "-9223372036854775808", - "-999999999999999999999999999999" - ], + "$comment": "XML Schema supports arbitrary precision integers. JSON's number type is limited to the safe integer range (±2^53-1) per IEEE 754. To properly validate arbitrary precision integers, use a JSON Schema evaluator that supports arbitrary precision integer handling", + "examples": [ -1, -42, -1000, -9223372036854775808 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.w3.org/TR/xmlschema-2/#negativeInteger" ], - "type": "string", - "pattern": "^-[1-9][0-9]*$" + "type": "integer", + "maximum": -1 } diff --git a/schemas/w3c/xmlschema/2001/non-negative-integer.json b/schemas/w3c/xmlschema/2001/non-negative-integer.json index f62c2a1b..f40bcb49 100644 --- a/schemas/w3c/xmlschema/2001/non-negative-integer.json +++ b/schemas/w3c/xmlschema/2001/non-negative-integer.json @@ -2,17 +2,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "W3C XML Schema nonNegativeInteger", "description": "Represents integers greater than or equal to zero (§3.3.20)", - "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", - "examples": [ - "0", - "1", - "42", - "1000", - "9223372036854775807", - "999999999999999999999999999999" - ], + "$comment": "XML Schema supports arbitrary precision integers. JSON's number type is limited to the safe integer range (±2^53-1) per IEEE 754. To properly validate arbitrary precision integers, use a JSON Schema evaluator that supports arbitrary precision integer handling", + "examples": [ 0, 1, 42, 1000, 9223372036854775807 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.w3.org/TR/xmlschema-2/#nonNegativeInteger" ], - "type": "string", - "pattern": "^(0|[1-9][0-9]*)$" + "type": "integer", + "minimum": 0 } diff --git a/schemas/w3c/xmlschema/2001/non-positive-integer.json b/schemas/w3c/xmlschema/2001/non-positive-integer.json index a8b248d0..aa1c2c16 100644 --- a/schemas/w3c/xmlschema/2001/non-positive-integer.json +++ b/schemas/w3c/xmlschema/2001/non-positive-integer.json @@ -2,17 +2,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "W3C XML Schema nonPositiveInteger", "description": "Represents integers less than or equal to zero (§3.3.14)", - "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", - "examples": [ - "0", - "-1", - "-42", - "-1000", - "-9223372036854775808", - "-999999999999999999999999999999" - ], + "$comment": "XML Schema supports arbitrary precision integers. JSON's number type is limited to the safe integer range (±2^53-1) per IEEE 754. To properly validate arbitrary precision integers, use a JSON Schema evaluator that supports arbitrary precision integer handling", + "examples": [ 0, -1, -42, -1000, -9223372036854775808 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.w3.org/TR/xmlschema-2/#nonPositiveInteger" ], - "type": "string", - "pattern": "^(0|-[1-9][0-9]*)$" + "type": "integer", + "maximum": 0 } diff --git a/schemas/w3c/xmlschema/2001/positive-integer.json b/schemas/w3c/xmlschema/2001/positive-integer.json index 087f50c2..c2c26f31 100644 --- a/schemas/w3c/xmlschema/2001/positive-integer.json +++ b/schemas/w3c/xmlschema/2001/positive-integer.json @@ -2,16 +2,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "W3C XML Schema positiveInteger", "description": "Represents strictly positive integers (§3.3.25)", - "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", - "examples": [ - "1", - "42", - "1000", - "9223372036854775807", - "999999999999999999999999999999" - ], + "$comment": "XML Schema supports arbitrary precision integers. JSON's number type is limited to the safe integer range (±2^53-1) per IEEE 754. To properly validate arbitrary precision integers, use a JSON Schema evaluator that supports arbitrary precision integer handling", + "examples": [ 1, 42, 1000, 9223372036854775807 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.w3.org/TR/xmlschema-2/#positiveInteger" ], - "type": "string", - "pattern": "^[1-9][0-9]*$" + "type": "integer", + "minimum": 1 } diff --git a/schemas/w3c/xmlschema/2001/unsigned-long.json b/schemas/w3c/xmlschema/2001/unsigned-long.json index c8b8ba05..8d371e1b 100644 --- a/schemas/w3c/xmlschema/2001/unsigned-long.json +++ b/schemas/w3c/xmlschema/2001/unsigned-long.json @@ -2,74 +2,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "W3C XML Schema unsignedLong", "description": "Represents 64-bit unsigned integers (§3.3.21)", - "$comment": "XML Schema unsignedLong supports the 64-bit unsigned range, but JSON Schema's integer type is limited to signed 64-bit integers. This schema uses string representation to maintain full XML Schema conformance", - "examples": [ - "0", - "1", - "18446744073709551615", - "9223372036854775808", - "4294967296" - ], + "$comment": "XML Schema supports arbitrary precision integers. JSON's number type is limited to the safe integer range (±2^53-1) per IEEE 754. To properly validate arbitrary precision integers, use a JSON Schema evaluator that supports arbitrary precision integer handling", + "examples": [ 0, 1, 9007199254740991, 4294967296 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.w3.org/TR/xmlschema-2/#unsignedLong" ], - "type": "string", - "anyOf": [ - { - "pattern": "^0$" - }, - { - "pattern": "^[1-9][0-9]{0,18}$" - }, - { - "pattern": "^1[0-7][0-9]{18}$" - }, - { - "pattern": "^18[0-3][0-9]{17}$" - }, - { - "pattern": "^184[0-3][0-9]{16}$" - }, - { - "pattern": "^1844[0-5][0-9]{15}$" - }, - { - "pattern": "^18446[0-6][0-9]{14}$" - }, - { - "pattern": "^184467[0-3][0-9]{13}$" - }, - { - "pattern": "^1844674[0-3][0-9]{12}$" - }, - { - "pattern": "^184467440[0-6][0-9]{10}$" - }, - { - "pattern": "^1844674407[0-2][0-9]{9}$" - }, - { - "pattern": "^18446744073[0-6][0-9]{8}$" - }, - { - "pattern": "^1844674407370[0-8][0-9]{6}$" - }, - { - "pattern": "^18446744073709[0-4][0-9]{5}$" - }, - { - "pattern": "^184467440737095[0-4][0-9]{4}$" - }, - { - "pattern": "^1844674407370955[0][0-9]{3}$" - }, - { - "pattern": "^18446744073709551[0-5][0-9]{2}$" - }, - { - "pattern": "^184467440737095516[0][0-9]$" - }, - { - "pattern": "^1844674407370955161[0-5]$" - } - ] + "type": "integer", + "minimum": 0 } diff --git a/schemas/xbrl/instance/2003/decimal-item-type.json b/schemas/xbrl/instance/2003/decimal-item-type.json index dca4fcbc..286222af 100644 --- a/schemas/xbrl/instance/2003/decimal-item-type.json +++ b/schemas/xbrl/instance/2003/decimal-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL decimalItemType", "description": "XBRL item type for decimal values. Based on W3C XML Schema decimal", - "examples": [ "123.45", "-67.89", "0.0" ], + "examples": [ 123.45, -67.89, 0.0 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/schemas/xbrl/instance/2003/fraction-item-type.json b/schemas/xbrl/instance/2003/fraction-item-type.json index e7a78b37..78699749 100644 --- a/schemas/xbrl/instance/2003/fraction-item-type.json +++ b/schemas/xbrl/instance/2003/fraction-item-type.json @@ -3,10 +3,10 @@ "title": "XBRL fractionItemType", "description": "XBRL item type for fractional values with explicit numerator and denominator. Represented as a two-element array of W3C XML Schema decimal values", "examples": [ - [ "1.5", "2" ], - [ "-100", "3.5" ], - [ "5", "-2.5" ], - [ "0", "1" ] + [ 1.5, 2 ], + [ -100, 3.5 ], + [ 5, -2.5 ], + [ 0, 1 ] ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ @@ -23,7 +23,7 @@ { "$ref": "../../../w3c/xmlschema/2001/decimal.json", "not": { - "pattern": "^-?0+(\\.0+)?$" + "const": 0 } } ] diff --git a/schemas/xbrl/instance/2003/integer-item-type.json b/schemas/xbrl/instance/2003/integer-item-type.json index 28bc576b..39136b20 100644 --- a/schemas/xbrl/instance/2003/integer-item-type.json +++ b/schemas/xbrl/instance/2003/integer-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL integerItemType", "description": "XBRL item type for arbitrary-precision signed integers. Based on W3C XML Schema integer", - "examples": [ "42", "-100", "0" ], + "examples": [ 42, -100, 0 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/schemas/xbrl/instance/2003/monetary-item-type.json b/schemas/xbrl/instance/2003/monetary-item-type.json index 1d92dcd8..f8f0d215 100644 --- a/schemas/xbrl/instance/2003/monetary-item-type.json +++ b/schemas/xbrl/instance/2003/monetary-item-type.json @@ -4,15 +4,15 @@ "description": "The monetary type serves as the datatype for those financial concepts in a taxonomy which denote units in a currency", "examples": [ { - "value": "100.50", + "value": 100.5, "currency": "USD" }, { - "value": "-25.00", + "value": -25.0, "currency": "EUR" }, { - "value": "0", + "value": 0, "currency": "GBP" } ], diff --git a/schemas/xbrl/instance/2003/negative-integer-item-type.json b/schemas/xbrl/instance/2003/negative-integer-item-type.json index 80bf7d04..7360f953 100644 --- a/schemas/xbrl/instance/2003/negative-integer-item-type.json +++ b/schemas/xbrl/instance/2003/negative-integer-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL negativeIntegerItemType", "description": "XBRL item type for arbitrary-precision negative integers (less than zero). Based on W3C XML Schema negativeInteger", - "examples": [ "-42", "-100", "-1" ], + "examples": [ -42, -100, -1 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/schemas/xbrl/instance/2003/non-negative-integer-item-type.json b/schemas/xbrl/instance/2003/non-negative-integer-item-type.json index 223a6205..f1032463 100644 --- a/schemas/xbrl/instance/2003/non-negative-integer-item-type.json +++ b/schemas/xbrl/instance/2003/non-negative-integer-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL nonNegativeIntegerItemType", "description": "XBRL item type for arbitrary-precision non-negative integers (zero or positive). Based on W3C XML Schema nonNegativeInteger", - "examples": [ "42", "100", "1" ], + "examples": [ 42, 100, 1 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/schemas/xbrl/instance/2003/non-positive-integer-item-type.json b/schemas/xbrl/instance/2003/non-positive-integer-item-type.json index ff330a81..2ba0a25f 100644 --- a/schemas/xbrl/instance/2003/non-positive-integer-item-type.json +++ b/schemas/xbrl/instance/2003/non-positive-integer-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL nonPositiveIntegerItemType", "description": "XBRL item type for arbitrary-precision non-positive integers (zero or negative). Based on W3C XML Schema nonPositiveInteger", - "examples": [ "-42", "-100", "0" ], + "examples": [ -42, -100, 0 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/schemas/xbrl/instance/2003/positive-integer-item-type.json b/schemas/xbrl/instance/2003/positive-integer-item-type.json index 8fdc1ac0..cd2c2553 100644 --- a/schemas/xbrl/instance/2003/positive-integer-item-type.json +++ b/schemas/xbrl/instance/2003/positive-integer-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL positiveIntegerItemType", "description": "XBRL item type for arbitrary-precision positive integers (greater than zero). Based on W3C XML Schema positiveInteger", - "examples": [ "42", "100", "1" ], + "examples": [ 42, 100, 1 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/schemas/xbrl/instance/2003/pure-item-type.json b/schemas/xbrl/instance/2003/pure-item-type.json index ffc60293..3110953c 100644 --- a/schemas/xbrl/instance/2003/pure-item-type.json +++ b/schemas/xbrl/instance/2003/pure-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL pureItemType", "description": "This datatype serves as the type for dimensionless numbers such as percentage change, growth rates, and other ratios where the numerator and denominator have the same units. Based on W3C XML Schema decimal", - "examples": [ "100.50", "-25.00", "0" ], + "examples": [ 100.5, -25.0, 0 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/schemas/xbrl/instance/2003/shares-item-type.json b/schemas/xbrl/instance/2003/shares-item-type.json index e3435e1a..0fc44b1c 100644 --- a/schemas/xbrl/instance/2003/shares-item-type.json +++ b/schemas/xbrl/instance/2003/shares-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL sharesItemType", "description": "This datatype serves as the datatype for share based financial concepts. Based on W3C XML Schema decimal", - "examples": [ "100.50", "-25.00", "0" ], + "examples": [ 100.5, -25.0, 0 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/schemas/xbrl/instance/2003/unsigned-long-item-type.json b/schemas/xbrl/instance/2003/unsigned-long-item-type.json index 39bf9af2..d7a3572c 100644 --- a/schemas/xbrl/instance/2003/unsigned-long-item-type.json +++ b/schemas/xbrl/instance/2003/unsigned-long-item-type.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "XBRL unsignedLongItemType", "description": "XBRL item type for arbitrary-precision unsigned 64-bit integers. Based on W3C XML Schema unsignedLong", - "examples": [ "42", "100", "1" ], + "examples": [ 42, 100, 1 ], "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", "x-links": [ "https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3", diff --git a/test/w3c/xmlschema/2001/decimal.test.json b/test/w3c/xmlschema/2001/decimal.test.json index 3274f6b7..c7b58a46 100644 --- a/test/w3c/xmlschema/2001/decimal.test.json +++ b/test/w3c/xmlschema/2001/decimal.test.json @@ -4,357 +4,124 @@ "tests": [ { "description": "Valid - positive integer", - "data": "123", + "data": 123, "valid": true }, { "description": "Valid - negative integer", - "data": "-456", + "data": -456, "valid": true }, { "description": "Valid - positive decimal", - "data": "123.45", + "data": 123.45, "valid": true }, { "description": "Valid - negative decimal", - "data": "-123.45", + "data": -123.45, "valid": true }, { "description": "Valid - zero", - "data": "0", + "data": 0, "valid": true }, { "description": "Valid - zero with decimal", - "data": "0.0", - "valid": true - }, - { - "description": "Valid - explicit positive sign", - "data": "+123.45", + "data": 0.0, "valid": true }, { "description": "Valid - many digits", - "data": "123456789012345678.901234567890", - "valid": true - }, - { - "description": "Invalid - no digits before decimal", - "data": ".123", - "valid": false - }, - { - "description": "Invalid - no digits after decimal", - "data": "123.", - "valid": false - }, - { - "description": "Invalid - scientific notation", - "data": "1.23E+10", - "valid": false - }, - { - "description": "Invalid - multiple decimal points", - "data": "123.45.67", - "valid": false - }, - { - "description": "Invalid - number type", - "data": 123.45, - "valid": false - }, - { - "description": "Invalid - empty string", - "data": "", - "valid": false - }, - { - "description": "Invalid - text", - "data": "abc", - "valid": false - }, - { - "description": "Valid - leading zeros integer", - "data": "007", - "valid": true - }, - { - "description": "Valid - leading zeros decimal", - "data": "000.123", - "valid": true - }, - { - "description": "Valid - all zeros", - "data": "0000000", + "data": 123456789012345, "valid": true }, { "description": "Valid - single digit", - "data": "5", + "data": 5, "valid": true }, { "description": "Valid - trailing zeros after decimal", - "data": "123.000", + "data": 123.0, "valid": true }, { "description": "Valid - many decimal places", - "data": "1.1234567890123456789", + "data": 1.12346, "valid": true }, { "description": "Valid - negative zero", - "data": "-0", - "valid": true - }, - { - "description": "Valid - positive zero with sign", - "data": "+0", - "valid": true - }, - { - "description": "Valid - negative zero with decimal", - "data": "-0.0", + "data": 0, "valid": true }, { "description": "Valid - only zero before decimal", - "data": "0.1", + "data": 0.1, "valid": true }, { "description": "Valid - single zero after decimal", - "data": "1.0", + "data": 1.0, "valid": true }, { - "description": "Valid - leading zeros with sign", - "data": "+0007.89", + "description": "Valid - large decimal", + "data": 123457, "valid": true }, { - "description": "Valid - negative leading zeros", - "data": "-000123", + "description": "Valid - small decimal", + "data": 1e-06, "valid": true }, { - "description": "Invalid - just plus sign", - "data": "+", - "valid": false - }, - { - "description": "Invalid - just minus sign", - "data": "-", - "valid": false - }, - { - "description": "Invalid - double plus", - "data": "++5", - "valid": false - }, - { - "description": "Invalid - double minus", - "data": "--5", - "valid": false - }, - { - "description": "Invalid - plus then minus", - "data": "+-5", - "valid": false - }, - { - "description": "Invalid - minus then plus", - "data": "-+5", - "valid": false - }, - { - "description": "Invalid - sign in middle", - "data": "12-34", - "valid": false - }, - { - "description": "Invalid - plus in middle", - "data": "12+34", - "valid": false - }, - { - "description": "Invalid - sign at end", - "data": "123-", - "valid": false - }, - { - "description": "Invalid - plus at end", - "data": "123+", - "valid": false - }, - { - "description": "Invalid - leading space", - "data": " 123", - "valid": false - }, - { - "description": "Invalid - trailing space", - "data": "123 ", - "valid": false - }, - { - "description": "Invalid - space in middle", - "data": "12 3", - "valid": false - }, - { - "description": "Invalid - space around decimal", - "data": "12 . 34", - "valid": false - }, - { - "description": "Invalid - only decimal point", - "data": ".", - "valid": false - }, - { - "description": "Invalid - double decimal consecutive", - "data": "12..34", - "valid": false - }, - { - "description": "Invalid - leading decimal with plus", - "data": "+.5", - "valid": false - }, - { - "description": "Invalid - leading decimal with minus", - "data": "-.5", - "valid": false - }, - { - "description": "Invalid - trailing decimal with plus", - "data": "+5.", - "valid": false - }, - { - "description": "Invalid - trailing decimal with minus", - "data": "-5.", - "valid": false - }, - { - "description": "Invalid - letter in number", - "data": "12a34", - "valid": false - }, - { - "description": "Invalid - lowercase e notation", - "data": "1.2e3", - "valid": false - }, - { - "description": "Invalid - uppercase E notation", - "data": "1.2E3", - "valid": false - }, - { - "description": "Invalid - comma separator", - "data": "1,234.56", - "valid": false - }, - { - "description": "Invalid - underscore separator", - "data": "1_234.56", - "valid": false - }, - { - "description": "Invalid - dollar sign", - "data": "$123", - "valid": false - }, - { - "description": "Invalid - tab character", - "data": "\t123", - "valid": false - }, - { - "description": "Invalid - multiple numbers with space", - "data": "123 456", - "valid": false - }, - { - "description": "Invalid - parentheses", - "data": "(123)", - "valid": false - }, - { - "description": "Invalid - negative with parentheses", - "data": "-(123)", - "valid": false - }, - { - "description": "Invalid - slash", - "data": "123/456", - "valid": false - }, - { - "description": "Invalid - colon", - "data": "123:456", - "valid": false - }, - { - "description": "Invalid - semicolon", - "data": "123;456", - "valid": false - }, - { - "description": "Invalid - hash", - "data": "#123", - "valid": false - }, - { - "description": "Invalid - percent", - "data": "123%", + "description": "Invalid - string type", + "data": "123.45", "valid": false }, { - "description": "Invalid - ampersand", - "data": "123&456", + "description": "Invalid - string with plus sign", + "data": "+123.45", "valid": false }, { - "description": "Invalid - asterisk", - "data": "123*456", + "description": "Invalid - string integer", + "data": "123", "valid": false }, { - "description": "Invalid - caret", - "data": "123^456", + "description": "Invalid - empty string", + "data": "", "valid": false }, { - "description": "Invalid - three consecutive decimals", - "data": "1...2", + "description": "Invalid - text", + "data": "abc", "valid": false }, { - "description": "Invalid - decimal before sign", - "data": ".+5", + "description": "Invalid - null", + "data": null, "valid": false }, { - "description": "Invalid - mixed valid and invalid", - "data": "123.45abc", + "description": "Invalid - boolean", + "data": true, "valid": false }, { - "description": "Invalid - trailing letters", - "data": "123xyz", + "description": "Invalid - array", + "data": [ 123.45 ], "valid": false }, { - "description": "Invalid - leading letters", - "data": "xyz123", + "description": "Invalid - object", + "data": { + "value": 123.45 + }, "valid": false } ] diff --git a/test/w3c/xmlschema/2001/integer.test.json b/test/w3c/xmlschema/2001/integer.test.json index 3df3585e..39ea6829 100644 --- a/test/w3c/xmlschema/2001/integer.test.json +++ b/test/w3c/xmlschema/2001/integer.test.json @@ -4,115 +4,95 @@ "tests": [ { "description": "Valid - zero", - "data": "0", + "data": 0, "valid": true }, { "description": "Valid - positive small", - "data": "1", + "data": 1, "valid": true }, { "description": "Valid - negative small", - "data": "-1", + "data": -1, "valid": true }, { "description": "Valid - positive large", - "data": "9223372036854775807", + "data": 9223372036854775807, "valid": true }, { "description": "Valid - negative large", - "data": "-9223372036854775808", + "data": -9223372036854775808, "valid": true }, { "description": "Valid - arbitrary positive", - "data": "42", + "data": 42, "valid": true }, { "description": "Valid - arbitrary negative", - "data": "-273", + "data": -273, "valid": true }, { "description": "Valid - medium positive", - "data": "1000000", + "data": 1000000, "valid": true }, { "description": "Valid - medium negative", - "data": "-1000000", - "valid": true - }, - { - "description": "Valid - very large (beyond 64-bit)", - "data": "999999999999999999999999999999", - "valid": true - }, - { - "description": "Valid - very small (beyond 64-bit)", - "data": "-999999999999999999999999999999", - "valid": true - }, - { - "description": "Valid - with plus sign", - "data": "+42", + "data": -1000000, "valid": true }, { - "description": "Invalid: decimal number", - "data": "1.5", + "description": "Invalid - decimal number", + "data": 123.45, "valid": false }, { - "description": "Invalid: leading zeros", - "data": "01", + "description": "Invalid - string type", + "data": "123", "valid": false }, { - "description": "Invalid: negative zero with leading zeros", - "data": "-00", + "description": "Invalid - string with plus sign", + "data": "+123", "valid": false }, { - "description": "Invalid: whitespace", - "data": " 42 ", + "description": "Invalid - empty string", + "data": "", "valid": false }, { - "description": "Invalid: number type", - "data": 42, + "description": "Invalid - text", + "data": "abc", "valid": false }, { - "description": "Invalid: boolean", - "data": true, + "description": "Invalid - null", + "data": null, "valid": false }, { - "description": "Invalid: null", - "data": null, + "description": "Invalid - boolean", + "data": true, "valid": false }, { - "description": "Invalid: array", - "data": [ "42" ], + "description": "Invalid - array", + "data": [ 123 ], "valid": false }, { - "description": "Invalid: object", + "description": "Invalid - object", "data": { - "value": "42" + "value": 123 }, "valid": false - }, - { - "description": "Invalid: empty string", - "data": "", - "valid": false } ] } diff --git a/test/w3c/xmlschema/2001/negative-integer.test.json b/test/w3c/xmlschema/2001/negative-integer.test.json index 9d48eacf..e9a274de 100644 --- a/test/w3c/xmlschema/2001/negative-integer.test.json +++ b/test/w3c/xmlschema/2001/negative-integer.test.json @@ -3,77 +3,67 @@ "target": "../../../../schemas/w3c/xmlschema/2001/negative-integer.json", "tests": [ { - "description": "Valid - negative one (boundary)", - "data": "-1", + "description": "Valid - negative one", + "data": -1, "valid": true }, { "description": "Valid - negative two", - "data": "-2", + "data": -2, "valid": true }, { "description": "Valid - small negative", - "data": "-42", + "data": -42, "valid": true }, { "description": "Valid - large negative", - "data": "-9223372036854775808", + "data": -9223372036854775808, "valid": true }, { "description": "Valid - medium negative", - "data": "-1000", - "valid": true - }, - { - "description": "Valid - very small (beyond 64-bit)", - "data": "-999999999999999999999999999999", + "data": -1000, "valid": true }, { - "description": "Invalid: zero (just above boundary)", - "data": "0", + "description": "Invalid - zero", + "data": 0, "valid": false }, { - "description": "Invalid: positive one", - "data": "1", + "description": "Invalid - positive one", + "data": 1, "valid": false }, { - "description": "Invalid: small positive", - "data": "42", + "description": "Invalid - small positive", + "data": 42, "valid": false }, { - "description": "Invalid: large positive", - "data": "9223372036854775807", + "description": "Invalid - large positive", + "data": 9223372036854775807, "valid": false }, { - "description": "Invalid: leading zeros", - "data": "-01", + "description": "Invalid - decimal number", + "data": -1.5, "valid": false }, { - "description": "Invalid: decimal number", - "data": "-1.5", - "valid": false - }, - { - "description": "Invalid: number type", - "data": -42, + "description": "Invalid - string type", + "data": "-1", "valid": false }, { - "description": "Invalid: boolean", + "description": "Invalid - boolean", "data": false, "valid": false }, { - "description": "Invalid: null", + "description": "Invalid - null", "data": null, "valid": false } diff --git a/test/w3c/xmlschema/2001/non-negative-integer.test.json b/test/w3c/xmlschema/2001/non-negative-integer.test.json index d3d376a7..b72d13d0 100644 --- a/test/w3c/xmlschema/2001/non-negative-integer.test.json +++ b/test/w3c/xmlschema/2001/non-negative-integer.test.json @@ -3,72 +3,62 @@ "target": "../../../../schemas/w3c/xmlschema/2001/non-negative-integer.json", "tests": [ { - "description": "Valid - zero (boundary)", - "data": "0", + "description": "Valid - zero", + "data": 0, "valid": true }, { "description": "Valid - one", - "data": "1", + "data": 1, "valid": true }, { "description": "Valid - small positive", - "data": "42", + "data": 42, "valid": true }, { "description": "Valid - large positive", - "data": "9223372036854775807", + "data": 9223372036854775807, "valid": true }, { "description": "Valid - medium positive", - "data": "1000", - "valid": true - }, - { - "description": "Valid - very large (beyond 64-bit)", - "data": "999999999999999999999999999999", + "data": 1000, "valid": true }, { - "description": "Invalid: negative one (just below boundary)", - "data": "-1", + "description": "Invalid - negative one", + "data": -1, "valid": false }, { - "description": "Invalid: small negative", - "data": "-42", + "description": "Invalid - small negative", + "data": -42, "valid": false }, { - "description": "Invalid: large negative", - "data": "-9223372036854775808", + "description": "Invalid - large negative", + "data": -9223372036854775808, "valid": false }, { - "description": "Invalid: leading zeros", - "data": "01", + "description": "Invalid - decimal number", + "data": 1.5, "valid": false }, { - "description": "Invalid: decimal number", - "data": "1.5", - "valid": false - }, - { - "description": "Invalid: number type", - "data": 42, + "description": "Invalid - string type", + "data": "0", "valid": false }, { - "description": "Invalid: boolean", + "description": "Invalid - boolean", "data": true, "valid": false }, { - "description": "Invalid: null", + "description": "Invalid - null", "data": null, "valid": false } diff --git a/test/w3c/xmlschema/2001/non-positive-integer.test.json b/test/w3c/xmlschema/2001/non-positive-integer.test.json index db270eb9..05fd518a 100644 --- a/test/w3c/xmlschema/2001/non-positive-integer.test.json +++ b/test/w3c/xmlschema/2001/non-positive-integer.test.json @@ -3,72 +3,62 @@ "target": "../../../../schemas/w3c/xmlschema/2001/non-positive-integer.json", "tests": [ { - "description": "Valid - zero (boundary)", - "data": "0", + "description": "Valid - zero", + "data": 0, "valid": true }, { "description": "Valid - negative one", - "data": "-1", + "data": -1, "valid": true }, { "description": "Valid - small negative", - "data": "-42", + "data": -42, "valid": true }, { "description": "Valid - large negative", - "data": "-9223372036854775808", + "data": -9223372036854775808, "valid": true }, { "description": "Valid - medium negative", - "data": "-1000", - "valid": true - }, - { - "description": "Valid - very small (beyond 64-bit)", - "data": "-999999999999999999999999999999", + "data": -1000, "valid": true }, { - "description": "Invalid: positive one (just above boundary)", - "data": "1", + "description": "Invalid - positive one", + "data": 1, "valid": false }, { - "description": "Invalid: small positive", - "data": "42", + "description": "Invalid - small positive", + "data": 42, "valid": false }, { - "description": "Invalid: large positive", - "data": "9223372036854775807", + "description": "Invalid - large positive", + "data": 9223372036854775807, "valid": false }, { - "description": "Invalid: leading zeros on negative", - "data": "-01", + "description": "Invalid - decimal number", + "data": -1.5, "valid": false }, { - "description": "Invalid: decimal number", - "data": "-1.5", - "valid": false - }, - { - "description": "Invalid: number type", - "data": -42, + "description": "Invalid - string type", + "data": "0", "valid": false }, { - "description": "Invalid: boolean", + "description": "Invalid - boolean", "data": false, "valid": false }, { - "description": "Invalid: null", + "description": "Invalid - null", "data": null, "valid": false } diff --git a/test/w3c/xmlschema/2001/positive-integer.test.json b/test/w3c/xmlschema/2001/positive-integer.test.json index 33602e67..b0383169 100644 --- a/test/w3c/xmlschema/2001/positive-integer.test.json +++ b/test/w3c/xmlschema/2001/positive-integer.test.json @@ -3,77 +3,72 @@ "target": "../../../../schemas/w3c/xmlschema/2001/positive-integer.json", "tests": [ { - "description": "Valid - one (boundary)", - "data": "1", + "description": "Valid - one", + "data": 1, "valid": true }, { "description": "Valid - two", - "data": "2", + "data": 2, "valid": true }, { "description": "Valid - small positive", - "data": "42", + "data": 42, "valid": true }, { "description": "Valid - large positive", - "data": "9223372036854775807", + "data": 9223372036854775807, "valid": true }, { "description": "Valid - medium positive", - "data": "1000", - "valid": true - }, - { - "description": "Valid - very large (beyond 64-bit)", - "data": "999999999999999999999999999999", + "data": 1000, "valid": true }, { - "description": "Invalid: zero (just below boundary)", - "data": "0", + "description": "Invalid - zero", + "data": 0, "valid": false }, { - "description": "Invalid: negative one", - "data": "-1", + "description": "Invalid - negative one", + "data": -1, "valid": false }, { - "description": "Invalid: small negative", - "data": "-42", + "description": "Invalid - small negative", + "data": -42, "valid": false }, { - "description": "Invalid: large negative", - "data": "-9223372036854775808", + "description": "Invalid - large negative", + "data": -9223372036854775808, "valid": false }, { - "description": "Invalid: leading zeros", - "data": "01", + "description": "Invalid - decimal number", + "data": 1.5, "valid": false }, { - "description": "Invalid: decimal number", - "data": "1.5", + "description": "Invalid - string type", + "data": "1", "valid": false }, { - "description": "Invalid: number type", - "data": 42, + "description": "Invalid - string with leading zeros", + "data": "01", "valid": false }, { - "description": "Invalid: boolean", + "description": "Invalid - boolean", "data": true, "valid": false }, { - "description": "Invalid: null", + "description": "Invalid - null", "data": null, "valid": false } diff --git a/test/w3c/xmlschema/2001/unsigned-long.test.json b/test/w3c/xmlschema/2001/unsigned-long.test.json index acc23d3a..b3cfb707 100644 --- a/test/w3c/xmlschema/2001/unsigned-long.test.json +++ b/test/w3c/xmlschema/2001/unsigned-long.test.json @@ -3,174 +3,74 @@ "target": "../../../../schemas/w3c/xmlschema/2001/unsigned-long.json", "tests": [ { - "description": "Valid - zero (minimum)", - "data": "0", + "description": "Valid - zero", + "data": 0, "valid": true }, { "description": "Valid - one", - "data": "1", + "data": 1, "valid": true }, { - "description": "Valid - maximum (18446744073709551615)", - "data": "18446744073709551615", + "description": "Valid - int64 max", + "data": 9223372036854775807, "valid": true }, { - "description": "Valid - above int64 max (9223372036854775808)", - "data": "9223372036854775808", - "valid": true - }, - { - "description": "Valid - int64 max (9223372036854775807)", - "data": "9223372036854775807", - "valid": true - }, - { - "description": "Valid - uint32 max (4294967296)", - "data": "4294967296", + "description": "Valid - uint32 max", + "data": 4294967296, "valid": true }, { "description": "Valid - arbitrary", - "data": "42", - "valid": true - }, - { - "description": "Valid - maximum value (18446744073709551615)", - "data": "18446744073709551615", - "valid": true - }, - { - "description": "Valid - one below maximum (18446744073709551614)", - "data": "18446744073709551614", - "valid": true - }, - { - "description": "Valid - 19 digits maximum (9999999999999999999)", - "data": "9999999999999999999", - "valid": true - }, - { - "description": "Valid - 20 digits starting with 1, second digit < 8", - "data": "17999999999999999999", - "valid": true - }, - { - "description": "Valid - 20 digits: 18399999999999999999", - "data": "18399999999999999999", - "valid": true - }, - { - "description": "Valid - 20 digits: 18446744073709551600", - "data": "18446744073709551600", + "data": 42, "valid": true }, { - "description": "Valid - no leading zeros for non-zero", - "data": "123", + "description": "Valid - large value", + "data": 123456789012345, "valid": true }, { - "description": "Invalid: exceeds maximum by 1 (18446744073709551616)", - "data": "18446744073709551616", - "valid": false - }, - { - "description": "Invalid: exceeds maximum (18446744073709551617)", - "data": "18446744073709551617", - "valid": false - }, - { - "description": "Invalid: exceeds maximum (18446744073709551620)", - "data": "18446744073709551620", + "description": "Invalid - negative one", + "data": -1, "valid": false }, { - "description": "Invalid: 20 digits starting with 2", - "data": "20000000000000000000", + "description": "Invalid - negative value", + "data": -1000, "valid": false }, { - "description": "Invalid: 20 digits: 19999999999999999999", - "data": "19999999999999999999", + "description": "Invalid - decimal point", + "data": 1.5, "valid": false }, { - "description": "Invalid: 20 digits: 18499999999999999999", - "data": "18499999999999999999", - "valid": false - }, - { - "description": "Invalid: 20 digits: 18446744073709551619", - "data": "18446744073709551619", - "valid": false - }, - { - "description": "Invalid: 21 digits", - "data": "100000000000000000000", - "valid": false - }, - { - "description": "Invalid: negative sign", - "data": "-1", - "valid": false - }, - { - "description": "Invalid: negative value", - "data": "-1000", - "valid": false - }, - { - "description": "Invalid: decimal point", - "data": "1.5", - "valid": false - }, - { - "description": "Invalid: positive sign", - "data": "+1", + "description": "Invalid - string type", + "data": "42", "valid": false }, { - "description": "Invalid: leading zeros", + "description": "Invalid - string with leading zeros", "data": "01", "valid": false }, { - "description": "Invalid: leading zeros multiple", - "data": "0042", - "valid": false - }, - { - "description": "Invalid: number type", - "data": 42, - "valid": false - }, - { - "description": "Invalid: boolean", + "description": "Invalid - boolean", "data": true, "valid": false }, { - "description": "Invalid: null", + "description": "Invalid - null", "data": null, "valid": false }, { - "description": "Invalid: empty string", + "description": "Invalid - empty string", "data": "", "valid": false - }, - { - "description": "Invalid: whitespace", - "data": " 42 ", - "valid": false - }, - { - "description": "Invalid: non-digit characters", - "data": "12abc", - "valid": false } ] } diff --git a/test/xbrl/instance/2003/decimal-item-type.test.json b/test/xbrl/instance/2003/decimal-item-type.test.json index 5f93a9df..35b42a1c 100644 --- a/test/xbrl/instance/2003/decimal-item-type.test.json +++ b/test/xbrl/instance/2003/decimal-item-type.test.json @@ -4,26 +4,31 @@ "tests": [ { "description": "Valid - positive decimal", - "data": "123.45", + "data": 123.45, "valid": true }, { "description": "Valid - negative decimal", - "data": "-67.89", + "data": -67.89, "valid": true }, { "description": "Valid - zero", - "data": "0", + "data": 0, "valid": true }, { "description": "Valid - high precision decimal", - "data": "3.141592653589793", + "data": 3.14159, "valid": true }, { - "description": "Invalid - not a decimal string", + "description": "Invalid - string type", + "data": "123.45", + "valid": false + }, + { + "description": "Invalid - text", "data": "abc", "valid": false }, @@ -33,8 +38,8 @@ "valid": false }, { - "description": "Invalid - number type instead of string", - "data": 123.45, + "description": "Invalid - null", + "data": null, "valid": false } ] diff --git a/test/xbrl/instance/2003/fraction-item-type.test.json b/test/xbrl/instance/2003/fraction-item-type.test.json index 0288c9f3..f054b531 100644 --- a/test/xbrl/instance/2003/fraction-item-type.test.json +++ b/test/xbrl/instance/2003/fraction-item-type.test.json @@ -4,107 +4,87 @@ "tests": [ { "description": "Valid - positive numerator and positive denominator", - "data": [ "1.5", "2" ], + "data": [ 1.5, 2 ], "valid": true }, { "description": "Valid - negative numerator and positive denominator", - "data": [ "-100", "3.5" ], + "data": [ -100, 3.5 ], "valid": true }, { "description": "Valid - positive numerator and negative denominator", - "data": [ "5", "-2.5" ], + "data": [ 5, -2.5 ], "valid": true }, { "description": "Valid - negative numerator and negative denominator", - "data": [ "-7", "-3" ], + "data": [ -7, -3 ], "valid": true }, { "description": "Valid - zero numerator with positive denominator", - "data": [ "0", "1" ], + "data": [ 0, 1 ], "valid": true }, { "description": "Valid - zero numerator with negative denominator", - "data": [ "0", "-5" ], + "data": [ 0, -5 ], "valid": true }, { "description": "Valid - zero numerator as decimal with positive denominator", - "data": [ "0.0", "2" ], + "data": [ 0.0, 2 ], "valid": true }, { "description": "Valid - whole number numerator and denominator", - "data": [ "3", "4" ], + "data": [ 3, 4 ], "valid": true }, { "description": "Valid - large positive values", - "data": [ "999999.999", "123456.789" ], + "data": [ 1000000.0, 123457 ], "valid": true }, { "description": "Valid - large negative denominator", - "data": [ "1", "-999999.999" ], + "data": [ 1, -1000000.0 ], "valid": true }, { "description": "Valid - very small fractional denominator", - "data": [ "100", "0.001" ], + "data": [ 100, 0.001 ], "valid": true }, { "description": "Valid - very small negative fractional denominator", - "data": [ "100", "-0.001" ], + "data": [ 100, -0.001 ], "valid": true }, { "description": "Invalid - zero denominator", - "data": [ "1", "0" ], + "data": [ 1, 0 ], "valid": false }, { "description": "Invalid - zero denominator as 0.0", - "data": [ "1", "0.0" ], - "valid": false - }, - { - "description": "Invalid - zero denominator as 0.00", - "data": [ "5", "0.00" ], - "valid": false - }, - { - "description": "Invalid - zero denominator as -0", - "data": [ "3", "-0" ], + "data": [ 1, 0.0 ], "valid": false }, { - "description": "Invalid - zero denominator as -0.0", - "data": [ "2", "-0.0" ], - "valid": false - }, - { - "description": "Invalid - zero denominator as 00", - "data": [ "1", "00" ], - "valid": false - }, - { - "description": "Invalid - zero denominator as 0.000", - "data": [ "1", "0.000" ], + "description": "Invalid - zero denominator as negative zero", + "data": [ 3, 0 ], "valid": false }, { "description": "Invalid - only one element", - "data": [ "1" ], + "data": [ 1 ], "valid": false }, { "description": "Invalid - three elements", - "data": [ "1", "2", "3" ], + "data": [ 1, 2, 3 ], "valid": false }, { @@ -113,28 +93,28 @@ "valid": false }, { - "description": "Invalid - non-decimal numerator", - "data": [ "abc", "2" ], + "description": "Invalid - string types instead of numbers", + "data": [ "1.5", "2" ], "valid": false }, { - "description": "Invalid - non-decimal denominator", - "data": [ "1", "xyz" ], + "description": "Invalid - string numerator", + "data": [ "abc", 2 ], "valid": false }, { - "description": "Invalid - number types instead of strings", - "data": [ 1.5, 2 ], + "description": "Invalid - string denominator", + "data": [ 1, "xyz" ], "valid": false }, { "description": "Invalid - null numerator", - "data": [ null, "1" ], + "data": [ null, 1 ], "valid": false }, { "description": "Invalid - null denominator", - "data": [ "1", null ], + "data": [ 1, null ], "valid": false } ] diff --git a/test/xbrl/instance/2003/integer-item-type.test.json b/test/xbrl/instance/2003/integer-item-type.test.json index cd31c2cb..bbde49e8 100644 --- a/test/xbrl/instance/2003/integer-item-type.test.json +++ b/test/xbrl/instance/2003/integer-item-type.test.json @@ -4,27 +4,32 @@ "tests": [ { "description": "Valid - positive integer", - "data": "42", + "data": 42, "valid": true }, { "description": "Valid - negative integer", - "data": "-100", + "data": -100, "valid": true }, { "description": "Valid - zero", - "data": "0", + "data": 0, "valid": true }, { "description": "Valid - large integer", - "data": "999999999999999999999999999999", + "data": 999999999999999, "valid": true }, { "description": "Invalid - decimal value", - "data": "123.45", + "data": 123.45, + "valid": false + }, + { + "description": "Invalid - string type", + "data": "42", "valid": false }, { @@ -33,8 +38,13 @@ "valid": false }, { - "description": "Invalid - number type instead of string", - "data": 42, + "description": "Invalid - null", + "data": null, + "valid": false + }, + { + "description": "Invalid - boolean", + "data": true, "valid": false } ] diff --git a/test/xbrl/instance/2003/monetary-item-type.test.json b/test/xbrl/instance/2003/monetary-item-type.test.json index 83915c53..a8d5935c 100644 --- a/test/xbrl/instance/2003/monetary-item-type.test.json +++ b/test/xbrl/instance/2003/monetary-item-type.test.json @@ -5,7 +5,7 @@ { "description": "Valid - positive monetary value in USD", "data": { - "value": "1234.56", + "value": 1234.56, "currency": "USD" }, "valid": true @@ -13,7 +13,7 @@ { "description": "Valid - negative monetary value in EUR", "data": { - "value": "-789.12", + "value": -789.12, "currency": "EUR" }, "valid": true @@ -21,7 +21,7 @@ { "description": "Valid - zero in GBP", "data": { - "value": "0", + "value": 0, "currency": "GBP" }, "valid": true @@ -29,7 +29,7 @@ { "description": "Valid - high precision in JPY", "data": { - "value": "12345.123456789", + "value": 12345.1, "currency": "JPY" }, "valid": true @@ -37,7 +37,7 @@ { "description": "Valid - large value in CHF", "data": { - "value": "999999999.99", + "value": 1000000000.0, "currency": "CHF" }, "valid": true @@ -45,31 +45,31 @@ { "description": "Valid - small fractional value in CAD", "data": { - "value": "0.01", + "value": 0.01, "currency": "CAD" }, "valid": true }, { - "description": "Invalid - not a decimal string in value", + "description": "Invalid - string type for value instead of number", "data": { - "value": "abc", + "value": "123.45", "currency": "USD" }, "valid": false }, { - "description": "Invalid - empty string value", + "description": "Invalid - text in value", "data": { - "value": "", + "value": "abc", "currency": "USD" }, "valid": false }, { - "description": "Invalid - number type for value instead of string", + "description": "Invalid - empty string value", "data": { - "value": 123.45, + "value": "", "currency": "USD" }, "valid": false @@ -84,14 +84,14 @@ { "description": "Invalid - missing currency field", "data": { - "value": "100.50" + "value": 100.5 }, "valid": false }, { "description": "Invalid - invalid currency code", "data": { - "value": "100.50", + "value": 100.5, "currency": "INVALID" }, "valid": false @@ -99,7 +99,7 @@ { "description": "Invalid - lowercase currency code", "data": { - "value": "100.50", + "value": 100.5, "currency": "usd" }, "valid": false @@ -116,7 +116,7 @@ }, { "description": "Invalid - array instead of object", - "data": [ "100.50", "USD" ], + "data": [ 100.5, "USD" ], "valid": false } ] diff --git a/test/xbrl/instance/2003/negative-integer-item-type.test.json b/test/xbrl/instance/2003/negative-integer-item-type.test.json index 8de095b1..a84ef647 100644 --- a/test/xbrl/instance/2003/negative-integer-item-type.test.json +++ b/test/xbrl/instance/2003/negative-integer-item-type.test.json @@ -4,37 +4,42 @@ "tests": [ { "description": "Valid - negative integer", - "data": "-42", + "data": -42, "valid": true }, { "description": "Valid - large negative integer", - "data": "-999999999999999999999999", + "data": -999999999999999999, "valid": true }, { "description": "Valid - negative one", - "data": "-1", + "data": -1, "valid": true }, { "description": "Invalid - zero", - "data": "0", + "data": 0, "valid": false }, { "description": "Invalid - positive integer", - "data": "1", + "data": 1, "valid": false }, { "description": "Invalid - decimal value", - "data": "-123.45", + "data": -123.45, "valid": false }, { - "description": "Invalid - number type instead of string", - "data": -42, + "description": "Invalid - string type", + "data": "-42", + "valid": false + }, + { + "description": "Invalid - null", + "data": null, "valid": false } ] diff --git a/test/xbrl/instance/2003/non-negative-integer-item-type.test.json b/test/xbrl/instance/2003/non-negative-integer-item-type.test.json index 8f8f9ec7..cd8a509b 100644 --- a/test/xbrl/instance/2003/non-negative-integer-item-type.test.json +++ b/test/xbrl/instance/2003/non-negative-integer-item-type.test.json @@ -4,32 +4,37 @@ "tests": [ { "description": "Valid - positive integer", - "data": "42", + "data": 42, "valid": true }, { "description": "Valid - zero", - "data": "0", + "data": 0, "valid": true }, { "description": "Valid - large positive integer", - "data": "999999999999999999999999", + "data": 999999999999999999, "valid": true }, { "description": "Invalid - negative integer", - "data": "-1", + "data": -1, "valid": false }, { "description": "Invalid - decimal value", - "data": "123.45", + "data": 123.45, "valid": false }, { - "description": "Invalid - number type instead of string", - "data": 42, + "description": "Invalid - string type", + "data": "42", + "valid": false + }, + { + "description": "Invalid - null", + "data": null, "valid": false } ] diff --git a/test/xbrl/instance/2003/non-positive-integer-item-type.test.json b/test/xbrl/instance/2003/non-positive-integer-item-type.test.json index c6c23ee1..a887c693 100644 --- a/test/xbrl/instance/2003/non-positive-integer-item-type.test.json +++ b/test/xbrl/instance/2003/non-positive-integer-item-type.test.json @@ -4,32 +4,37 @@ "tests": [ { "description": "Valid - negative integer", - "data": "-42", + "data": -42, "valid": true }, { "description": "Valid - zero", - "data": "0", + "data": 0, "valid": true }, { "description": "Valid - large negative integer", - "data": "-999999999999999999999999", + "data": -999999999999999999, "valid": true }, { "description": "Invalid - positive integer", - "data": "1", + "data": 1, "valid": false }, { "description": "Invalid - decimal value", - "data": "-123.45", + "data": -123.45, "valid": false }, { - "description": "Invalid - number type instead of string", - "data": 0, + "description": "Invalid - string type", + "data": "0", + "valid": false + }, + { + "description": "Invalid - null", + "data": null, "valid": false } ] diff --git a/test/xbrl/instance/2003/positive-integer-item-type.test.json b/test/xbrl/instance/2003/positive-integer-item-type.test.json index db5c8881..47e0c390 100644 --- a/test/xbrl/instance/2003/positive-integer-item-type.test.json +++ b/test/xbrl/instance/2003/positive-integer-item-type.test.json @@ -4,37 +4,42 @@ "tests": [ { "description": "Valid - positive integer", - "data": "42", + "data": 42, "valid": true }, { "description": "Valid - large positive integer", - "data": "999999999999999999999999", + "data": 999999999999999999, "valid": true }, { "description": "Valid - one", - "data": "1", + "data": 1, "valid": true }, { "description": "Invalid - zero", - "data": "0", + "data": 0, "valid": false }, { "description": "Invalid - negative integer", - "data": "-1", + "data": -1, "valid": false }, { "description": "Invalid - decimal value", - "data": "123.45", + "data": 123.45, "valid": false }, { - "description": "Invalid - number type instead of string", - "data": 42, + "description": "Invalid - string type", + "data": "42", + "valid": false + }, + { + "description": "Invalid - null", + "data": null, "valid": false } ] diff --git a/test/xbrl/instance/2003/pure-item-type.test.json b/test/xbrl/instance/2003/pure-item-type.test.json index c7985d3f..b6682400 100644 --- a/test/xbrl/instance/2003/pure-item-type.test.json +++ b/test/xbrl/instance/2003/pure-item-type.test.json @@ -4,26 +4,31 @@ "tests": [ { "description": "Valid - pure number as decimal", - "data": "0.5", + "data": 0.5, "valid": true }, { "description": "Valid - whole number", - "data": "1", + "data": 1, "valid": true }, { "description": "Valid - negative pure number", - "data": "-0.25", + "data": -0.25, "valid": true }, { "description": "Valid - high precision", - "data": "0.123456789", + "data": 0.123457, "valid": true }, { - "description": "Invalid - not a decimal string", + "description": "Invalid - string type", + "data": "0.5", + "valid": false + }, + { + "description": "Invalid - text", "data": "not-a-number", "valid": false }, @@ -33,8 +38,8 @@ "valid": false }, { - "description": "Invalid - number type instead of string", - "data": 0.5, + "description": "Invalid - null", + "data": null, "valid": false } ] diff --git a/test/xbrl/instance/2003/shares-item-type.test.json b/test/xbrl/instance/2003/shares-item-type.test.json index eb83ba62..aed35d2a 100644 --- a/test/xbrl/instance/2003/shares-item-type.test.json +++ b/test/xbrl/instance/2003/shares-item-type.test.json @@ -4,26 +4,31 @@ "tests": [ { "description": "Valid - whole shares", - "data": "1000", + "data": 1000, "valid": true }, { "description": "Valid - fractional shares", - "data": "123.456", + "data": 123.456, "valid": true }, { "description": "Valid - zero shares", - "data": "0", + "data": 0, "valid": true }, { "description": "Valid - high precision fractional shares", - "data": "9876.123456", + "data": 9876.12, "valid": true }, { - "description": "Invalid - not a decimal string", + "description": "Invalid - string type", + "data": "1000", + "valid": false + }, + { + "description": "Invalid - text", "data": "xyz", "valid": false }, @@ -33,8 +38,8 @@ "valid": false }, { - "description": "Invalid - number type instead of string", - "data": 1000, + "description": "Invalid - null", + "data": null, "valid": false } ] diff --git a/test/xbrl/instance/2003/unsigned-long-item-type.test.json b/test/xbrl/instance/2003/unsigned-long-item-type.test.json index c028e840..d1ae8756 100644 --- a/test/xbrl/instance/2003/unsigned-long-item-type.test.json +++ b/test/xbrl/instance/2003/unsigned-long-item-type.test.json @@ -4,32 +4,37 @@ "tests": [ { "description": "Valid - positive unsigned long", - "data": "123456789", + "data": 123456789, "valid": true }, { "description": "Valid - zero", - "data": "0", + "data": 0, "valid": true }, { "description": "Valid - large unsigned long", - "data": "18446744073709551615", + "data": 9007199254740991, "valid": true }, { "description": "Invalid - negative value", - "data": "-1", + "data": -1, "valid": false }, { "description": "Invalid - decimal value", - "data": "123.45", + "data": 123.45, "valid": false }, { - "description": "Invalid - number type instead of string", - "data": 123456789, + "description": "Invalid - string type", + "data": "123456789", + "valid": false + }, + { + "description": "Invalid - null", + "data": null, "valid": false } ]