Skip to content

Commit 2f921a2

Browse files
committed
Merge branch 'main' of github.com:chanced/jsonpointer
2 parents dd629d4 + ebcd517 commit 2f921a2

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
# jsonpointer - an [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901) implementation for Go
22

3+
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://pkg.go.dev/github.com/chanced/jsonpointer)
4+
35
Package jsonpointer provides the ability to resolve, assign, and delete values
46
of any type, including raw JSON, by [JSON
57
Pointers](https://datatracker.ietf.org/doc/html/rfc6901).
68

7-
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://pkg.go.dev/github.com/chanced/jsonpointer)
8-
9-
## Motivation
10-
11-
jsonpointer was built to support
12-
[github.com/chanced/openapi](https://github.com/chanced/openapi) but it may be
13-
useful for others so it has been released as an independent package.
14-
15-
For the openapi package, I needed a way to resolve and assign JSON Pointers
16-
against concrete types while also maintaining integrity of pointer values. All
17-
existing JSON Pointer implementations for Go operate on `map[string]interface{}`
18-
and `[]interface{}`, raw JSON, or both.
199

2010
## Install
2111

@@ -110,7 +100,7 @@ Package jsonpointer provides 3 interfaces: `Assigner`, `Resolver`, and
110100
called. `ResolveJSONPointer` should not have side effects. If resolving for an assignment, utilize the
111101
pointer to infer which type should be assigned.
112102

113-
Both `AssignByJSONPointer` and `DeleteByJSONPointer` are invoked on the way back from the leaf.
103+
`AssignByJSONPointer` is invoked on the way back from the leaf. `DeleteByJSONPointer` is invoked after resolving the current token.
114104

115105
All three methods are passed a pointer to the `jsonpointer.JSONPointer` so that
116106
it can be modified. If you do not modify it, jsonpointer will assume the current
@@ -168,7 +158,7 @@ This package is reflect heavy. While it employs the same caching mechanics as
168158
`encoding/json` to help alleviate some of the lookup costs, there will always be
169159
a performance hit with reflection.
170160

171-
There are also probably plenty of ways to improve performance of the package.
161+
There are probably plenty of ways to improve performance of the package.
172162
Improvements or criticisms are always welcome.
173163

174164
With regards to raw JSON, `json.Marshal` and `json.Unmarshal` are utilized.

0 commit comments

Comments
 (0)