From f948ef1e10611cfcaf002a1fb97e6c5f48a081c7 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Tue, 14 Oct 2025 16:46:15 -0700 Subject: [PATCH 1/3] Set fetch timeout for tests --- lib/schema.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/schema.spec.ts b/lib/schema.spec.ts index 0ee02de..cd44a4d 100644 --- a/lib/schema.spec.ts +++ b/lib/schema.spec.ts @@ -1,4 +1,5 @@ import { describe, it, expect, afterEach } from "vitest"; +import { Agent, setGlobalDispatcher } from "undici"; import { RetrievalError } from "@hyperjump/browser"; import { registerSchema, unregisterSchema } from "./index.js"; import { getSchema, hasDialect } from "./experimental.js"; @@ -9,6 +10,8 @@ import "../draft-07/index.js"; import "../draft-04/index.js"; +setGlobalDispatcher(new Agent({ connect: { timeout: 100 } })); + describe("Schema Parsing", () => { const testDomain = "https://test.hyperjump.io"; From a9c88167d097a24e74a426667830179bf59569e9 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Mon, 20 Oct 2025 12:54:43 -0700 Subject: [PATCH 2/3] Improve error types --- annotations/index.d.ts | 2 +- lib/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/annotations/index.d.ts b/annotations/index.d.ts index 42c662a..75de9ce 100644 --- a/annotations/index.d.ts +++ b/annotations/index.d.ts @@ -15,7 +15,7 @@ export type Annotator = (value: Json, options?: OutputFormat | ValidationOptions export const interpret: (compiledSchema: CompiledSchema, value: JsonNode, options?: OutputFormat | ValidationOptions) => JsonNode; export class ValidationError extends Error { - public output: Output; + public output: Output & { valid: false }; public constructor(output: Output); } diff --git a/lib/index.d.ts b/lib/index.d.ts index b361465..b9799e0 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -56,7 +56,7 @@ export const setShouldValidateSchema: (isEnabled: boolean) => void; export const getShouldValidateSchema: () => boolean; export class InvalidSchemaError extends Error { - public output: Output; + public output: Output & { valid: false }; public constructor(output: Output); } From dc58152c19c234d7f3164eab76a2d33178054f20 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Mon, 20 Oct 2025 12:55:04 -0700 Subject: [PATCH 3/3] 1.16.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cf377f1..6021e58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hyperjump/json-schema", - "version": "1.16.3", + "version": "1.16.4", "description": "A JSON Schema validator with support for custom keywords, vocabularies, and dialects", "type": "module", "main": "./stable/index.js",