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); } 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"; 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",