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/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. /// 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