kubernetes-sigs_nfs-subdir-.../vendor/sigs.k8s.io/json
Yonatan Kahana fed959e469
fix: resolve all trivy vulnerabilities (2023-06-06)
- bump go version to 1.17
- resolved: CVE-2022-21698, CVE-2022-27664, CVE-2022-41723, CVE-2022-41717, CVE-2022-29526, CVE-2022-32149, CVE-2022-28948.
2023-06-06 23:44:58 +03:00
..
internal/golang/encoding/json rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
CONTRIBUTING.md rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
LICENSE rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
Makefile rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
OWNERS rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
README.md rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
SECURITY.md rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
SECURITY_CONTACTS rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
code-of-conduct.md rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
doc.go rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30
json.go rebase: update kube version to 1.23 2022-03-03 12:58:23 +05:30

README.md

sigs.k8s.io/json

Go Reference

Introduction

This library is a subproject of sig-api-machinery. It provides case-sensitive, integer-preserving JSON unmarshaling functions based on encoding/json Unmarshal().

Compatibility

The UnmarshalCaseSensitivePreserveInts() function behaves like encoding/json#Unmarshal() with the following differences:

  • JSON object keys are treated case-sensitively. Object keys must exactly match json tag names (for tagged struct fields) or struct field names (for untagged struct fields).
  • JSON integers are unmarshaled into interface{} fields as an int64 instead of a float64 when possible, falling back to float64 on any parse or overflow error.
  • Syntax errors do not return an encoding/json *SyntaxError error. Instead, they return an error which can be passed to SyntaxErrorOffset() to obtain an offset.

Additional capabilities

The UnmarshalStrict() function decodes identically to UnmarshalCaseSensitivePreserveInts(), and also returns non-fatal strict errors encountered while decoding:

  • Duplicate fields encountered
  • Unknown fields encountered

Community, discussion, contribution, and support

You can reach the maintainers of this project via the sig-api-machinery mailing list / channels.

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.