You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// jsonpointer.JSONPointer is a string type so if you have a properly
40
+
// jsonpointer.Pointer is a string type so if you have a properly
42
41
// formatted json pointer then you can simply convert it:
43
-
// ptr := jsonpointer.JSONPointer(myPointer)
42
+
// ptr := jsonpointer.Pointer(myPointer)
44
43
// err := ptr.Validate()
45
44
46
45
// Note: jsonpointer.New encodes each token's value.
@@ -96,24 +95,24 @@ func main() {
96
95
### Interfaces
97
96
98
97
Package jsonpointer provides 3 interfaces: `Assigner`, `Resolver`, and
99
-
`Deleter`. Regardless of the operation, if `Resolver` is implemented, `ResolveJSONPointer` will be
100
-
called. `ResolveJSONPointer` should not have side effects. If resolving for an assignment, utilize the
98
+
`Deleter`. Regardless of the operation, if `Resolver` is implemented, `ResolvePointer` will be
99
+
called. `ResolvePointer` should not have side effects. If resolving for an assignment, utilize the
101
100
pointer to infer which type should be assigned.
102
101
103
-
`AssignByJSONPointer` is invoked on the way back from the leaf. `DeleteByJSONPointer` is invoked after resolving the current token.
102
+
`AssignByPointer` is invoked on the way back from the leaf. `DeleteByPointer` is invoked after resolving the current token.
104
103
105
-
All three methods are passed a pointer to the `jsonpointer.JSONPointer` so that
104
+
All three methods are passed a pointer to the `jsonpointer.Pointer` so that
106
105
it can be modified. If you do not modify it, jsonpointer will assume the current
107
106
token was addressed and continue on.
108
107
109
108
If you wish to only handle some cases with the interfaces, return `jsonpointer.YieldOperation` to have the jsonpointer package resolve, assign, or delete as if the type did not implement the interface. Note that doing so results in changes to `ptr` being dismissed.
110
109
111
-
### JSONPointer methods
110
+
### Pointer methods
112
111
113
112
All methods return new values rather than modifying the pointer itself. If you wish to modify the pointer in one of the interface methods, you will need to reassign it: `*ptr = newPtrVal`
0 commit comments