Skip to content

Commit 87f5385

Browse files
committed
feat: expose instanceLocation on ValidationError
1 parent 3c52f82 commit 87f5385

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
- The validation API may now throw errors if the provided JSON Schema is
88
invalid.
99

10+
- The structure of ValidationError has changed to include further information
11+
such as the location of the failing instance. ValidationError was previous a
12+
String.
13+
1014
### Enhancements
1115

1216
- The failing required validation error message is now emitted for each

Sources/JSONPointer.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

33

4-
struct JSONPointer {
4+
public struct JSONPointer {
55
var components: [String]
66

77
init() {
@@ -16,7 +16,7 @@ struct JSONPointer {
1616
}
1717
}
1818

19-
var path: String {
19+
public var path: String {
2020
return components
2121
.map {
2222
$0

Sources/ValidationResult.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ public class ValidationError {
66
self.instanceLocation = instanceLocation
77
}
88

9-
// FIXME make this part of public interface
10-
let instanceLocation: JSONPointer
9+
public let instanceLocation: JSONPointer
1110
}
1211

1312

0 commit comments

Comments
 (0)