Skip to content

Tags: tidwall/gjson

Tags

v1.18.0

Generally faster parsing

This commit includes an optimization that increases overall
performance.

The gains are roughly between 20% to 300% depending on the size
of the JSON document. Larger documents will see the greates gains,
particularly when searching for keys that are deeply embedded, or
near the end of the document.

v1.17.3

Add flag for disabling HTML escaping

Adds the DisableEscapeHTML flag for disable the automatic
escaping of the HTML characters '>', '<' and '&'.

The previous commit introduced a potentially breaking change by
removing HTML escaping altogether. This commit fixes that issue
by allowing the user to choose at runtime.

v1.17.2

Disable html escaping

This commit removes the automatic escaping of html characters,
effectively rendering JSON strings in the same way as is the
builtin Go encoder with SetEscapeHTML(false).
This should not affect the quality of the resulting JSON and
hopefully will not cause any downstream issues.

v1.17.1

Fix backspace and form-feed for Go 1.22

v1.17.0

Added Escape function

This commit adds the Escape function for escaping a path
component, making it possible to directly querying keys that have
special characters like dots.

```
json := `{
  "user":{
      "first.name": "Janet",
      "last.name": "Prichard"
    }
}`
user := gjson.Get(json, "user")
println(user.Get(gjson.Escape("first.name")).String())
println(user.Get(gjson.Escape("last.name")).String())
// Output:
// Janet
// Prichard
```

See #333

v1.16.0

Mention the dig modifier

v1.15.0

Added new tilde types and fixed ~false

This commit fixes an issue with ~false where the it's value was
simply the opposite of ~true. Now ~false explicitly checks for
false-ish values.

Also added ~null and ~* for testing null-ish and non-existent
values.

see #327

v1.14.4

Add test

v1.14.3

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #291 from janisz/master

Handle modifiers with options

v1.14.2

Allow for Index > 0 on path compontent that are not modifiers.

This commit fixes an issue where non-modifier path components
such as '@hello' return 0 for the Result.Index value.