We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf25e7d commit 757b9e5Copy full SHA for 757b9e5
Sources/RefResolver.swift
@@ -1,9 +1,15 @@
1
import Foundation
2
3
func urlSplitFragment(url: String) -> (String, String) {
4
+ #if swift(>=5.0)
5
+ guard let hashIndex = url.firstIndex(of: "#") else {
6
+ return (url, "")
7
+ }
8
+ #else
9
guard let hashIndex = url.index(of: "#") else {
10
return (url, "")
11
}
12
+ #endif
13
14
return (
15
String(url.prefix(upTo: hashIndex)),
Tests/JSONSchemaTests/Validation/TestRequired.swift
@@ -21,7 +21,7 @@ public let testRequired: ((ContextType) -> Void) = {
21
let error = errors[0]
22
23
try expect(error.description) == "Required property 'test' is missing"
24
- try expect(error.instanceLocation.path) == "/0"
+ try expect(error.instanceLocation.path) == "/0/test"
25
try expect(error.keywordLocation.path) == "#/items/required"
26
27
0 commit comments