From e0b4e758e7afcf1ae20e532f9f14e6cf9d90e328 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 18 Nov 2025 10:17:16 -0400 Subject: [PATCH 1/2] Define a schema for 64-bit unsigned integers Signed-off-by: Juan Cruz Viotti --- schemas/iso/c/2024/uint64.json | 12 +++ schemas/w3c/xmlschema/2001/unsigned-long.json | 3 +- test/iso/c/2024/uint64.test.json | 86 +++++++++++++++++++ 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 schemas/iso/c/2024/uint64.json create mode 100644 test/iso/c/2024/uint64.test.json diff --git a/schemas/iso/c/2024/uint64.json b/schemas/iso/c/2024/uint64.json new file mode 100644 index 00000000..cb0ee3f5 --- /dev/null +++ b/schemas/iso/c/2024/uint64.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO/IEC 9899:2024 Unsigned 64-bit Integer (uint64_t)", + "description": "An unsigned integer type with width of exactly 64 bits", + "$comment": "This schema requires a JSON Schema evaluator that supports big integers beyond the 64-bit signed integer interoperability guidelines defined in RFC 8259 for the JSON grammar", + "examples": [ 0, 1, 18446744073709551615, 9223372036854775808, 42 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.iso.org/standard/82075.html" ], + "type": "integer", + "maximum": 18446744073709551615, + "minimum": 0 +} diff --git a/schemas/w3c/xmlschema/2001/unsigned-long.json b/schemas/w3c/xmlschema/2001/unsigned-long.json index 8d371e1b..8de039bf 100644 --- a/schemas/w3c/xmlschema/2001/unsigned-long.json +++ b/schemas/w3c/xmlschema/2001/unsigned-long.json @@ -6,6 +6,5 @@ "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": "integer", - "minimum": 0 + "$ref": "../../../iso/c/2024/uint64.json" } diff --git a/test/iso/c/2024/uint64.test.json b/test/iso/c/2024/uint64.test.json new file mode 100644 index 00000000..c62bead6 --- /dev/null +++ b/test/iso/c/2024/uint64.test.json @@ -0,0 +1,86 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/c/2024/uint64.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - minimum value", + "data": 0, + "valid": true + }, + { + "description": "Valid - maximum value", + "data": 18446744073709551615, + "valid": true + }, + { + "description": "Valid - mid-range value", + "data": 9223372036854775808, + "valid": true + }, + { + "description": "Valid - positive value", + "data": 42, + "valid": true + }, + { + "description": "Valid - large value", + "data": 10000000000000000000, + "valid": true + }, + { + "description": "Invalid - negative value", + "data": -1, + "valid": false + }, + { + "description": "Invalid - above maximum", + "data": 18446744073709551616, + "valid": false + }, + { + "description": "Invalid - large above maximum", + "data": 20000000000000000000, + "valid": false + }, + { + "description": "Invalid - large negative value", + "data": -1000, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "42", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + }, + { + "description": "Invalid type - float", + "data": 42.5, + "valid": false + } + ] +} From 1ac4eacea6fcf8b06f8b8c23b411877d1d8b0294 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 18 Nov 2025 10:23:22 -0400 Subject: [PATCH 2/2] Try CLI from GitHub Actions Signed-off-by: Juan Cruz Viotti --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba5f02d0..41115ac6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - run: sudo snap install jsonschema + - uses: sourcemeta/jsonschema@v12.4.0 - uses: actions/checkout@v4 - run: make lint - run: make test