From c2b8fddd546815c64c25a3ebcda8bcc723e77844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Carcele=CC=81n?= Date: Sun, 19 Apr 2026 12:11:55 +0200 Subject: [PATCH 1/2] Use FoundationEssentials when available --- Sources/JSONSchema/JSONSchema.swift | 4 ++++ Tests/JSONSchemaTests/JSONSchemaTests.swift | 4 ++++ Tests/JSONSchemaTests/JSONValueTests.swift | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/Sources/JSONSchema/JSONSchema.swift b/Sources/JSONSchema/JSONSchema.swift index da18af5..c9f3f1a 100644 --- a/Sources/JSONSchema/JSONSchema.swift +++ b/Sources/JSONSchema/JSONSchema.swift @@ -1,4 +1,8 @@ +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif import OrderedCollections #if canImport(RegexBuilder) diff --git a/Tests/JSONSchemaTests/JSONSchemaTests.swift b/Tests/JSONSchemaTests/JSONSchemaTests.swift index 1d98277..4d5a951 100644 --- a/Tests/JSONSchemaTests/JSONSchemaTests.swift +++ b/Tests/JSONSchemaTests/JSONSchemaTests.swift @@ -1,4 +1,8 @@ +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif import Testing @testable import JSONSchema diff --git a/Tests/JSONSchemaTests/JSONValueTests.swift b/Tests/JSONSchemaTests/JSONValueTests.swift index 7367bd1..28d1467 100644 --- a/Tests/JSONSchemaTests/JSONValueTests.swift +++ b/Tests/JSONSchemaTests/JSONValueTests.swift @@ -1,4 +1,8 @@ +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif import Testing @testable import JSONSchema From c377dc19b4b97ce8a41350c742f594021a3d8413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Carcele=CC=81n?= Date: Fri, 24 Apr 2026 18:24:51 +0200 Subject: [PATCH 2/2] Use FoundationEssentials imports in JSONValue --- Sources/JSONSchema/JSONValue.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/JSONSchema/JSONValue.swift b/Sources/JSONSchema/JSONValue.swift index 38e40fc..3ab3ff2 100644 --- a/Sources/JSONSchema/JSONValue.swift +++ b/Sources/JSONSchema/JSONValue.swift @@ -1,6 +1,12 @@ +#if canImport(FoundationEssentials) +import struct FoundationEssentials.Data +import class FoundationEssentials.JSONDecoder +import class FoundationEssentials.JSONEncoder +#else import struct Foundation.Data import class Foundation.JSONDecoder import class Foundation.JSONEncoder +#endif /// A representation of a JSON value. ///