diff --git a/.gitignore b/.gitignore
index 0e03e15..ae8e107 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,28 @@
/.build/
+
+# Xcode
+#
+# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
+
+## User settings
+xcuserdata/
+
+## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
+*.xcscmblueprint
+*.xccheckout
+
+## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
+build/
+DerivedData/
+*.moved-aside
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+
+## Gcc Patch
+/*.gcno
diff --git a/JSONSchema.xcodeproj/JSONSchemaTests_Info.plist b/JSONSchema.xcodeproj/JSONSchemaTests_Info.plist
new file mode 100644
index 0000000..7c23420
--- /dev/null
+++ b/JSONSchema.xcodeproj/JSONSchemaTests_Info.plist
@@ -0,0 +1,25 @@
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ BNDL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+ NSPrincipalClass
+
+
+
diff --git a/JSONSchema.xcodeproj/JSONSchema_Info.plist b/JSONSchema.xcodeproj/JSONSchema_Info.plist
new file mode 100644
index 0000000..b4349eb
--- /dev/null
+++ b/JSONSchema.xcodeproj/JSONSchema_Info.plist
@@ -0,0 +1,25 @@
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1
+ NSPrincipalClass
+
+
+
diff --git a/JSONSchema.xcodeproj/PathKit_Info.plist b/JSONSchema.xcodeproj/PathKit_Info.plist
new file mode 100644
index 0000000..57ada9f
--- /dev/null
+++ b/JSONSchema.xcodeproj/PathKit_Info.plist
@@ -0,0 +1,25 @@
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+ NSPrincipalClass
+
+
+
diff --git a/JSONSchema.xcodeproj/project.pbxproj b/JSONSchema.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..57196cb
--- /dev/null
+++ b/JSONSchema.xcodeproj/project.pbxproj
@@ -0,0 +1,876 @@
+// !$*UTF8*$!
+{
+ archiveVersion = "1";
+ objectVersion = "46";
+ objects = {
+ "JSONSchema::JSONSchema" = {
+ isa = "PBXNativeTarget";
+ buildConfigurationList = "OBJ_33";
+ buildPhases = (
+ "OBJ_36",
+ "OBJ_45"
+ );
+ dependencies = (
+ );
+ name = "JSONSchema";
+ productName = "JSONSchema";
+ productReference = "JSONSchema::JSONSchema::Product";
+ productType = "com.apple.product-type.framework";
+ };
+ "JSONSchema::JSONSchema::Product" = {
+ isa = "PBXFileReference";
+ path = "JSONSchema.framework";
+ sourceTree = "BUILT_PRODUCTS_DIR";
+ };
+ "JSONSchema::JSONSchemaPackageTests::ProductTarget" = {
+ isa = "PBXAggregateTarget";
+ buildConfigurationList = "OBJ_53";
+ buildPhases = (
+ );
+ dependencies = (
+ "OBJ_56"
+ );
+ name = "JSONSchemaPackageTests";
+ productName = "JSONSchemaPackageTests";
+ };
+ "JSONSchema::JSONSchemaTests" = {
+ isa = "PBXNativeTarget";
+ buildConfigurationList = "OBJ_58";
+ buildPhases = (
+ "OBJ_61",
+ "OBJ_64"
+ );
+ dependencies = (
+ "OBJ_67",
+ "OBJ_69"
+ );
+ name = "JSONSchemaTests";
+ productName = "JSONSchemaTests";
+ productReference = "JSONSchema::JSONSchemaTests::Product";
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ "JSONSchema::JSONSchemaTests::Product" = {
+ isa = "PBXFileReference";
+ path = "JSONSchemaTests.xctest";
+ sourceTree = "BUILT_PRODUCTS_DIR";
+ };
+ "JSONSchema::SwiftPMPackageDescription" = {
+ isa = "PBXNativeTarget";
+ buildConfigurationList = "OBJ_47";
+ buildPhases = (
+ "OBJ_50"
+ );
+ dependencies = (
+ );
+ name = "JSONSchemaPackageDescription";
+ productName = "JSONSchemaPackageDescription";
+ productType = "com.apple.product-type.framework";
+ };
+ "OBJ_1" = {
+ isa = "PBXProject";
+ attributes = {
+ LastSwiftMigration = "9999";
+ LastUpgradeCheck = "9999";
+ };
+ buildConfigurationList = "OBJ_2";
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = "en";
+ hasScannedForEncodings = "0";
+ knownRegions = (
+ "en"
+ );
+ mainGroup = "OBJ_5";
+ productRefGroup = "OBJ_24";
+ projectDirPath = ".";
+ targets = (
+ "JSONSchema::JSONSchema",
+ "JSONSchema::SwiftPMPackageDescription",
+ "JSONSchema::JSONSchemaPackageTests::ProductTarget",
+ "JSONSchema::JSONSchemaTests",
+ "PathKit::PathKit",
+ "PathKit::SwiftPMPackageDescription"
+ );
+ };
+ "OBJ_10" = {
+ isa = "PBXFileReference";
+ path = "Draft6Validator.swift";
+ sourceTree = "";
+ };
+ "OBJ_11" = {
+ isa = "PBXFileReference";
+ path = "Draft7Validator.swift";
+ sourceTree = "";
+ };
+ "OBJ_12" = {
+ isa = "PBXFileReference";
+ path = "JSONSchema.swift";
+ sourceTree = "";
+ };
+ "OBJ_13" = {
+ isa = "PBXFileReference";
+ path = "RefResolver.swift";
+ sourceTree = "";
+ };
+ "OBJ_14" = {
+ isa = "PBXFileReference";
+ path = "Validator.swift";
+ sourceTree = "";
+ };
+ "OBJ_15" = {
+ isa = "PBXFileReference";
+ path = "Validators.swift";
+ sourceTree = "";
+ };
+ "OBJ_16" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_17"
+ );
+ name = "Tests";
+ path = "";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_17" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_18",
+ "OBJ_19"
+ );
+ name = "JSONSchemaTests";
+ path = "Tests/JSONSchemaTests";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_18" = {
+ isa = "PBXFileReference";
+ path = "JSONSchemaCases.swift";
+ sourceTree = "";
+ };
+ "OBJ_19" = {
+ isa = "PBXFileReference";
+ path = "JSONSchemaTests.swift";
+ sourceTree = "";
+ };
+ "OBJ_2" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_3",
+ "OBJ_4"
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Release";
+ };
+ "OBJ_20" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_21"
+ );
+ name = "Dependencies";
+ path = "";
+ sourceTree = "";
+ };
+ "OBJ_21" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_22",
+ "OBJ_23"
+ );
+ name = "PathKit 1.0.0";
+ path = ".build/checkouts/PathKit/Sources";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_22" = {
+ isa = "PBXFileReference";
+ explicitFileType = "sourcecode.swift";
+ name = "Package.swift";
+ path = "/Users/ismailmustafa/Desktop/projects/JSONSchema.swift/.build/checkouts/PathKit/Package.swift";
+ sourceTree = "";
+ };
+ "OBJ_23" = {
+ isa = "PBXFileReference";
+ path = "PathKit.swift";
+ sourceTree = "";
+ };
+ "OBJ_24" = {
+ isa = "PBXGroup";
+ children = (
+ "JSONSchema::JSONSchema::Product",
+ "PathKit::PathKit::Product",
+ "JSONSchema::JSONSchemaTests::Product"
+ );
+ name = "Products";
+ path = "";
+ sourceTree = "BUILT_PRODUCTS_DIR";
+ };
+ "OBJ_28" = {
+ isa = "PBXFileReference";
+ path = "LICENSE";
+ sourceTree = "";
+ };
+ "OBJ_29" = {
+ isa = "PBXFileReference";
+ path = "JSONSchema.podspec";
+ sourceTree = "";
+ };
+ "OBJ_3" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = "YES";
+ COMBINE_HIDPI_IMAGES = "YES";
+ COPY_PHASE_STRIP = "NO";
+ DEBUG_INFORMATION_FORMAT = "dwarf";
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_NS_ASSERTIONS = "YES";
+ GCC_OPTIMIZATION_LEVEL = "0";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ "SWIFT_PACKAGE=1",
+ "DEBUG=1"
+ );
+ MACOSX_DEPLOYMENT_TARGET = "10.10";
+ ONLY_ACTIVE_ARCH = "YES";
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)",
+ "-DXcode"
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = "macosx";
+ SUPPORTED_PLATFORMS = (
+ "macosx",
+ "iphoneos",
+ "iphonesimulator",
+ "appletvos",
+ "appletvsimulator",
+ "watchos",
+ "watchsimulator"
+ );
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
+ "$(inherited)",
+ "SWIFT_PACKAGE",
+ "DEBUG"
+ );
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ USE_HEADERMAP = "NO";
+ };
+ name = "Debug";
+ };
+ "OBJ_30" = {
+ isa = "PBXFileReference";
+ path = "CHANGELOG.md";
+ sourceTree = "";
+ };
+ "OBJ_31" = {
+ isa = "PBXFileReference";
+ path = "README.md";
+ sourceTree = "";
+ };
+ "OBJ_33" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_34",
+ "OBJ_35"
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Release";
+ };
+ "OBJ_34" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ ENABLE_TESTABILITY = "YES";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks"
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)"
+ );
+ INFOPLIST_FILE = "JSONSchema.xcodeproj/JSONSchema_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"
+ );
+ OTHER_CFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)"
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "JSONSchema";
+ PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = "YES";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
+ "$(inherited)"
+ );
+ SWIFT_VERSION = "4.2";
+ TARGET_NAME = "JSONSchema";
+ };
+ name = "Debug";
+ };
+ "OBJ_35" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ ENABLE_TESTABILITY = "YES";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks"
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)"
+ );
+ INFOPLIST_FILE = "JSONSchema.xcodeproj/JSONSchema_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"
+ );
+ OTHER_CFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)"
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "JSONSchema";
+ PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = "YES";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
+ "$(inherited)"
+ );
+ SWIFT_VERSION = "4.2";
+ TARGET_NAME = "JSONSchema";
+ };
+ name = "Release";
+ };
+ "OBJ_36" = {
+ isa = "PBXSourcesBuildPhase";
+ files = (
+ "OBJ_37",
+ "OBJ_38",
+ "OBJ_39",
+ "OBJ_40",
+ "OBJ_41",
+ "OBJ_42",
+ "OBJ_43",
+ "OBJ_44"
+ );
+ };
+ "OBJ_37" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_8";
+ };
+ "OBJ_38" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_9";
+ };
+ "OBJ_39" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_10";
+ };
+ "OBJ_4" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = "YES";
+ COMBINE_HIDPI_IMAGES = "YES";
+ COPY_PHASE_STRIP = "YES";
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ GCC_OPTIMIZATION_LEVEL = "s";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ "SWIFT_PACKAGE=1"
+ );
+ MACOSX_DEPLOYMENT_TARGET = "10.10";
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)",
+ "-DXcode"
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = "macosx";
+ SUPPORTED_PLATFORMS = (
+ "macosx",
+ "iphoneos",
+ "iphonesimulator",
+ "appletvos",
+ "appletvsimulator",
+ "watchos",
+ "watchsimulator"
+ );
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
+ "$(inherited)",
+ "SWIFT_PACKAGE"
+ );
+ SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+ USE_HEADERMAP = "NO";
+ };
+ name = "Release";
+ };
+ "OBJ_40" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_11";
+ };
+ "OBJ_41" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_12";
+ };
+ "OBJ_42" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_13";
+ };
+ "OBJ_43" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_14";
+ };
+ "OBJ_44" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_15";
+ };
+ "OBJ_45" = {
+ isa = "PBXFrameworksBuildPhase";
+ files = (
+ );
+ };
+ "OBJ_47" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_48",
+ "OBJ_49"
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Release";
+ };
+ "OBJ_48" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ LD = "/usr/bin/true";
+ OTHER_SWIFT_FLAGS = (
+ "-swift-version",
+ "4.2",
+ "-I",
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2",
+ "-target",
+ "x86_64-apple-macosx10.10",
+ "-sdk",
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk",
+ "-package-description-version",
+ "4.2"
+ );
+ SWIFT_VERSION = "4.2";
+ };
+ name = "Debug";
+ };
+ "OBJ_49" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ LD = "/usr/bin/true";
+ OTHER_SWIFT_FLAGS = (
+ "-swift-version",
+ "4.2",
+ "-I",
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2",
+ "-target",
+ "x86_64-apple-macosx10.10",
+ "-sdk",
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk",
+ "-package-description-version",
+ "4.2"
+ );
+ SWIFT_VERSION = "4.2";
+ };
+ name = "Release";
+ };
+ "OBJ_5" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_6",
+ "OBJ_7",
+ "OBJ_16",
+ "OBJ_20",
+ "OBJ_24",
+ "OBJ_28",
+ "OBJ_29",
+ "OBJ_30",
+ "OBJ_31"
+ );
+ path = "";
+ sourceTree = "";
+ };
+ "OBJ_50" = {
+ isa = "PBXSourcesBuildPhase";
+ files = (
+ "OBJ_51"
+ );
+ };
+ "OBJ_51" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_6";
+ };
+ "OBJ_53" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_54",
+ "OBJ_55"
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Release";
+ };
+ "OBJ_54" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ };
+ name = "Debug";
+ };
+ "OBJ_55" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ };
+ name = "Release";
+ };
+ "OBJ_56" = {
+ isa = "PBXTargetDependency";
+ target = "JSONSchema::JSONSchemaTests";
+ };
+ "OBJ_58" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_59",
+ "OBJ_60"
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Release";
+ };
+ "OBJ_59" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ CLANG_ENABLE_MODULES = "YES";
+ EMBEDDED_CONTENT_CONTAINS_SWIFT = "YES";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks"
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)"
+ );
+ INFOPLIST_FILE = "JSONSchema.xcodeproj/JSONSchemaTests_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@loader_path/../Frameworks",
+ "@loader_path/Frameworks"
+ );
+ OTHER_CFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)"
+ );
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
+ "$(inherited)"
+ );
+ SWIFT_VERSION = "4.2";
+ TARGET_NAME = "JSONSchemaTests";
+ };
+ name = "Debug";
+ };
+ "OBJ_6" = {
+ isa = "PBXFileReference";
+ explicitFileType = "sourcecode.swift";
+ path = "Package.swift";
+ sourceTree = "";
+ };
+ "OBJ_60" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ CLANG_ENABLE_MODULES = "YES";
+ EMBEDDED_CONTENT_CONTAINS_SWIFT = "YES";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks"
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)"
+ );
+ INFOPLIST_FILE = "JSONSchema.xcodeproj/JSONSchemaTests_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@loader_path/../Frameworks",
+ "@loader_path/Frameworks"
+ );
+ OTHER_CFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)"
+ );
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
+ "$(inherited)"
+ );
+ SWIFT_VERSION = "4.2";
+ TARGET_NAME = "JSONSchemaTests";
+ };
+ name = "Release";
+ };
+ "OBJ_61" = {
+ isa = "PBXSourcesBuildPhase";
+ files = (
+ "OBJ_62",
+ "OBJ_63"
+ );
+ };
+ "OBJ_62" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_18";
+ };
+ "OBJ_63" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_19";
+ };
+ "OBJ_64" = {
+ isa = "PBXFrameworksBuildPhase";
+ files = (
+ "OBJ_65",
+ "OBJ_66"
+ );
+ };
+ "OBJ_65" = {
+ isa = "PBXBuildFile";
+ fileRef = "PathKit::PathKit::Product";
+ };
+ "OBJ_66" = {
+ isa = "PBXBuildFile";
+ fileRef = "JSONSchema::JSONSchema::Product";
+ };
+ "OBJ_67" = {
+ isa = "PBXTargetDependency";
+ target = "PathKit::PathKit";
+ };
+ "OBJ_69" = {
+ isa = "PBXTargetDependency";
+ target = "JSONSchema::JSONSchema";
+ };
+ "OBJ_7" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_8",
+ "OBJ_9",
+ "OBJ_10",
+ "OBJ_11",
+ "OBJ_12",
+ "OBJ_13",
+ "OBJ_14",
+ "OBJ_15"
+ );
+ name = "Sources";
+ path = "Sources";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_70" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_71",
+ "OBJ_72"
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Release";
+ };
+ "OBJ_71" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ ENABLE_TESTABILITY = "YES";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks"
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)"
+ );
+ INFOPLIST_FILE = "JSONSchema.xcodeproj/PathKit_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"
+ );
+ OTHER_CFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)"
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "PathKit";
+ PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = "YES";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
+ "$(inherited)"
+ );
+ SWIFT_VERSION = "4.2";
+ TARGET_NAME = "PathKit";
+ };
+ name = "Debug";
+ };
+ "OBJ_72" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ ENABLE_TESTABILITY = "YES";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks"
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)"
+ );
+ INFOPLIST_FILE = "JSONSchema.xcodeproj/PathKit_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"
+ );
+ OTHER_CFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)"
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)"
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "PathKit";
+ PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = "YES";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
+ "$(inherited)"
+ );
+ SWIFT_VERSION = "4.2";
+ TARGET_NAME = "PathKit";
+ };
+ name = "Release";
+ };
+ "OBJ_73" = {
+ isa = "PBXSourcesBuildPhase";
+ files = (
+ "OBJ_74"
+ );
+ };
+ "OBJ_74" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_23";
+ };
+ "OBJ_75" = {
+ isa = "PBXFrameworksBuildPhase";
+ files = (
+ );
+ };
+ "OBJ_77" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_78",
+ "OBJ_79"
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Release";
+ };
+ "OBJ_78" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ LD = "/usr/bin/true";
+ OTHER_SWIFT_FLAGS = (
+ "-swift-version",
+ "4.2",
+ "-I",
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2",
+ "-target",
+ "x86_64-apple-macosx10.10",
+ "-sdk",
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk",
+ "-package-description-version",
+ "4.2"
+ );
+ SWIFT_VERSION = "4.2";
+ };
+ name = "Debug";
+ };
+ "OBJ_79" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ LD = "/usr/bin/true";
+ OTHER_SWIFT_FLAGS = (
+ "-swift-version",
+ "4.2",
+ "-I",
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2",
+ "-target",
+ "x86_64-apple-macosx10.10",
+ "-sdk",
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk",
+ "-package-description-version",
+ "4.2"
+ );
+ SWIFT_VERSION = "4.2";
+ };
+ name = "Release";
+ };
+ "OBJ_8" = {
+ isa = "PBXFileReference";
+ path = "Draft201909Validator.swift";
+ sourceTree = "";
+ };
+ "OBJ_80" = {
+ isa = "PBXSourcesBuildPhase";
+ files = (
+ "OBJ_81"
+ );
+ };
+ "OBJ_81" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_22";
+ };
+ "OBJ_9" = {
+ isa = "PBXFileReference";
+ path = "Draft4Validator.swift";
+ sourceTree = "";
+ };
+ "PathKit::PathKit" = {
+ isa = "PBXNativeTarget";
+ buildConfigurationList = "OBJ_70";
+ buildPhases = (
+ "OBJ_73",
+ "OBJ_75"
+ );
+ dependencies = (
+ );
+ name = "PathKit";
+ productName = "PathKit";
+ productReference = "PathKit::PathKit::Product";
+ productType = "com.apple.product-type.framework";
+ };
+ "PathKit::PathKit::Product" = {
+ isa = "PBXFileReference";
+ path = "PathKit.framework";
+ sourceTree = "BUILT_PRODUCTS_DIR";
+ };
+ "PathKit::SwiftPMPackageDescription" = {
+ isa = "PBXNativeTarget";
+ buildConfigurationList = "OBJ_77";
+ buildPhases = (
+ "OBJ_80"
+ );
+ dependencies = (
+ );
+ name = "PathKitPackageDescription";
+ productName = "PathKitPackageDescription";
+ productType = "com.apple.product-type.framework";
+ };
+ };
+ rootObject = "OBJ_1";
+}
diff --git a/JSONSchema.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/JSONSchema.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..fe1aa71
--- /dev/null
+++ b/JSONSchema.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/JSONSchema.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/JSONSchema.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/JSONSchema.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/JSONSchema.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/JSONSchema.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..a72dc2b
--- /dev/null
+++ b/JSONSchema.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded
+
+
+
\ No newline at end of file
diff --git a/JSONSchema.xcodeproj/xcshareddata/xcschemes/JSONSchema-Package.xcscheme b/JSONSchema.xcodeproj/xcshareddata/xcschemes/JSONSchema-Package.xcscheme
new file mode 100644
index 0000000..e30ceda
--- /dev/null
+++ b/JSONSchema.xcodeproj/xcshareddata/xcschemes/JSONSchema-Package.xcscheme
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Sources/Draft201909Validator.swift b/Sources/Draft201909Validator.swift
index e10d3c3..55b8d00 100644
--- a/Sources/Draft201909Validator.swift
+++ b/Sources/Draft201909Validator.swift
@@ -49,7 +49,10 @@ public class Draft201909Validator: Validator {
"ipv4": validateIPv4,
"ipv6": validateIPv6,
"uri": validateURI,
- "uuid": validateUUID,
+ "date-time": validateDateTime,
+ "date": validateDate,
+ "time": validateTime,
+ "uuid": validateUUID
]
public required init(schema: Bool) {
diff --git a/Sources/Draft7Validator.swift b/Sources/Draft7Validator.swift
index 43245b4..e9b6286 100644
--- a/Sources/Draft7Validator.swift
+++ b/Sources/Draft7Validator.swift
@@ -44,6 +44,9 @@ public class Draft7Validator: Validator {
"ipv4": validateIPv4,
"ipv6": validateIPv6,
"uri": validateURI,
+ "date-time": validateDateTime,
+ "date": validateDate,
+ "time": validateTime
]
public required init(schema: Bool) {
diff --git a/Sources/Validators.swift b/Sources/Validators.swift
index ab55f03..1901316 100644
--- a/Sources/Validators.swift
+++ b/Sources/Validators.swift
@@ -789,6 +789,57 @@ func validateURI(_ value: Any) -> AnySequence {
}
+func validateDateTime(_ value: Any) -> AnySequence {
+ if let date = value as? String {
+ let rfc3339DateTimeFormatter = DateFormatter()
+ rfc3339DateTimeFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
+ rfc3339DateTimeFormatter.timeZone = TimeZone(secondsFromGMT: 0)
+
+ if rfc3339DateTimeFormatter.date(from: date) != nil {
+ return AnySequence(EmptyCollection())
+ }
+
+ return AnySequence(["'\(date)' is not a valid RFC 3339 formatted date-time."])
+ }
+
+ return AnySequence(EmptyCollection())
+}
+
+
+func validateDate(_ value: Any) -> AnySequence {
+ if let date = value as? String {
+ let rfc3339DateTimeFormatter = DateFormatter()
+ rfc3339DateTimeFormatter.dateFormat = "yyyy-MM-dd"
+ rfc3339DateTimeFormatter.timeZone = TimeZone(secondsFromGMT: 0)
+
+ if rfc3339DateTimeFormatter.date(from: date) != nil {
+ return AnySequence(EmptyCollection())
+ }
+
+ return AnySequence(["'\(date)' is not a valid RFC 3339 formatted date."])
+ }
+
+ return AnySequence(EmptyCollection())
+}
+
+
+func validateTime(_ value: Any) -> AnySequence {
+ if let date = value as? String {
+ let rfc3339DateTimeFormatter = DateFormatter()
+ rfc3339DateTimeFormatter.dateFormat = "HH:mm:ssZZZZZ"
+ rfc3339DateTimeFormatter.timeZone = TimeZone(secondsFromGMT: 0)
+
+ if rfc3339DateTimeFormatter.date(from: date) != nil {
+ return AnySequence(EmptyCollection())
+ }
+
+ return AnySequence(["'\(date)' is not a valid RFC 3339 formatted time."])
+ }
+
+ return AnySequence(EmptyCollection())
+}
+
+
func validateUUID(_ value: Any) -> AnySequence {
if let value = value as? String {
if UUID(uuidString: value) == nil {
diff --git a/Tests/JSONSchemaTests/JSONSchemaCases.swift b/Tests/JSONSchemaTests/JSONSchemaCases.swift
index a657a5f..f13b13b 100644
--- a/Tests/JSONSchemaTests/JSONSchemaCases.swift
+++ b/Tests/JSONSchemaTests/JSONSchemaCases.swift
@@ -112,8 +112,6 @@ class JSONSchemaCases: XCTestCase {
"ecmascript-regex.json",
// optional, format
- "date-time.json",
- "date.json",
"email.json",
"hostname.json",
"idn-email.json",
@@ -123,7 +121,6 @@ class JSONSchemaCases: XCTestCase {
"json-pointer.json",
"regex.json",
"relative-json-pointer.json",
- "time.json",
"uri-reference.json",
"uri-template.json",
])
@@ -148,8 +145,6 @@ class JSONSchemaCases: XCTestCase {
"ecmascript-regex.json",
// optional, format
- "date-time.json",
- "date.json",
"duration.json",
"email.json",
"hostname.json",
@@ -160,7 +155,6 @@ class JSONSchemaCases: XCTestCase {
"json-pointer.json",
"regex.json",
"relative-json-pointer.json",
- "time.json",
"uri-reference.json",
"uri-template.json",
])