Jsonnet

Latest version: v0.20.0

Safety actively analyzes 722491 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 7

0.21.0rc2

0.21.0rc1

This is the first release candidate for v0.21.0. Since this is the first release for jsonnet for nearly 2 years, and since the build systems and packaging tools have changed somewhat since the last release, this release candidate is being published first to give an opportunity for jsonnet users to report any major build breakage or other problems that would make the release fundamentally unusable.

A corresponding PyPI package is published at: https://pypi.org/project/jsonnet/0.21.0rc1/

What's Changed

Bug fixes

- std.all, std.any - had incorrect error reporting (1101)
- std.parseYaml - RapidYAML updated to version 0.5.0; fixes various details (942, 1014, 1050)
- Printed number output is now independent of global system locale (722)
- UTF-8 input representing Unicode characters outside the Basic Multilingual Plane were not decoded correctly (1181)
- Field visibility is now inherited as expected in objects constructed by object-comprehension expressions (1111) [this was already the case in go-jsonnet, now fixed in C++ jsonnet]
- [Windows] On Windows, backslash is now supported as a directory separator (in imports)
- [go-jsonnet] YAML streams were incorrectly detected for some inputs to parseYAML (go-jsonnet/673)
- [go-jsonnet] Internal error in conversion of native functions results to numbers (go-jsonnet/752)

Language changes
- Array slices can now have negative start and/or end indexes; these are now wrapped-around (similar behaviour to Python).
- Multiline text blocks can now start with `|||-` to cause a trailing newline to be trimmed. (289)

New standard library functionality

- std.contains
- std.objectRemoveKey
- std.remove
- std.removeAt
- std.flattenDeepArray
- std.minArray
- std.maxArray
- std.avg
- std.isEven
- std.isOdd
- std.isInteger
- std.isDecimal
- std.atan2
- std.hypot
- std.pi (constant)
- std.deg2rad
- std.rad2deg
- std.log2
- std.log10
- std.equalsIgnoreCase
- std.trim
- [go-jsonnet only] std.sha1
- [go-jsonnet only] std.sha256
- [go-jsonnet only] std.sha512
- [go-jsonnet only] std.sha3
- [go-jsonnet only] std.manifestYamlDoc is now implemented in native Go
- [go-jsonnet only] std.escapeStringJson is now implemented in native Go
- [go-jsonnet only] std.splitLimitR is now implemented in native Go

Build & dependency changes

- Bazel build now has a MODULE.bazel for bzlmod compatibility.
- [C++ jsonnet] Python build should now work on Windows / MSVC
- [C++ jsonnet] Bazel build now uses rules_python
- [C++ jsonnet] RapidYAML updated to 0.5.0
- [go-jsonnet] The formatter package now provides FormatNode() and SnippetToRawAST() functions (go-jsonnet/710)
- [go-jsonnet] golang.org/x/crypto updated from 0.17.0 to 0.33.0
- PyPI packages are now published direct from GitHub Actions and come with publisher attestations.
- Python wheel packages are built for some environments.

New Contributors
* toge made their first contribution in https://github.com/google/jsonnet/pull/1076
* netomi made their first contribution in https://github.com/google/jsonnet/pull/1073
* deepgoel17 made their first contribution in https://github.com/google/jsonnet/pull/1074
* mortenmj made their first contribution in https://github.com/google/jsonnet/pull/1083
* bitmaybewise made their first contribution in https://github.com/google/jsonnet/pull/1082
* osher made their first contribution in https://github.com/google/jsonnet/pull/1095
* fedya-at-db made their first contribution in https://github.com/google/jsonnet/pull/1011
* rudo-thomas made their first contribution in https://github.com/google/jsonnet/pull/1103
* podsvirov made their first contribution in https://github.com/google/jsonnet/pull/1112
* ashi009 made their first contribution in https://github.com/google/jsonnet/pull/1102
* johnbartholomew made their first contribution in https://github.com/google/jsonnet/pull/1127
* pmorch made their first contribution in https://github.com/google/jsonnet/pull/943
* worrycare made their first contribution in https://github.com/google/jsonnet/pull/1146
* itchyny made their first contribution in https://github.com/google/jsonnet/pull/1149
* eduardosm made their first contribution in https://github.com/google/jsonnet/pull/1156
* olpa made their first contribution in https://github.com/google/jsonnet/pull/1176
* danipozo made their first contribution in https://github.com/google/jsonnet/pull/1150
* r-barnes made their first contribution in https://github.com/google/jsonnet/pull/1161
* rben01 made their first contribution in https://github.com/google/jsonnet/pull/1187
* vergenzt made their first contribution in https://github.com/google/jsonnet/pull/1175

**Full Commit list**: https://github.com/google/jsonnet/compare/v0.20.0...v0.21.0-rc1

0.20.0

Bug fix

This release has a bug fix for `std.member` on strings (https://github.com/google/go-jsonnet/issues/656)


Standard library additions

- `std.escapeStringXML`
- `std.sum`
- `std.xor`
- `std.xnor`
- `std.isEmpty`
- `std.round`
- `std.objectKeysValues` (convert an object to a list of pairs)
- `std.objectKeysValuesAll`


jsonnet-go specific updates:

jsonnet-deps and jsonnet-lint are now included in releases

0.19.2pre2

This is a special pre-release intended to test new build settings.

0.19.2pre1

This is a special pre-release intended to test new build settings.

0.19.1

The previous v0.19.0 release had a small change in the C bindings to allow `importbin` to function, but missing from the release notes was mention of the fact that the Python bindings had also changed in a similar way - to require the content of the file to be provided as a `bytes` type instead of a `str`. To convert from `str` to `bytes`, simply call `.encode()` on the `str`.

In order to write Python code that works for both Jsonnet versions, the Jsonnet version is now provided as a field of the _jsonnet module, which allows writing code like the following:


import _jsonnet
import semver

import_returns_bytes = semver.compare(getattr(_jsonnet, 'version', 'v0.18.0')[1:], '0.18.0') > 0

def no_nl_eof(directory, rel):
if import_returns_bytes:
return "foo.jsonnet", b"42"
else:
return "foo.jsonnet", "42"

_jsonnet.evaluate_snippet("test.jsonnet", "{\nlocal foo = import 'foo.jsonnet',\n \n 'bar': foo\n }\n", import_callback=no_nl_eof)


This release also fixes an off-by-one truncation error in the import callback logic of the Python bindings introduced in the previous release. This was only noticeable if the imported file had no trailing \n, or if you were using `importbin` with a Python import callback.

Page 1 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.