The problems the post names
This is a surprising default, a potential security vulnerability, and a performance limitation. [1]
Unfortunately, these problems are inherent consequences of the existing API, making them practically impossible to fix within the Go 1 compatibility promise. [2]
Why a new major version
Introducing a new, incompatible major version of a package is a heavy consideration. [3]
If possible, we should try to fix the existing package. [4]
While it is relatively easy to add new features, it is difficult to change existing features. [5]
What the new decoders do differently
Generally, decoders have become stricter at rejecting ambiguous inputs, to reduce the chance that two implementations will have different (successful) interpretations of a particular JSON value. [6]
After additional feedback and refinement, the new encoding/json/v2 and encoding/json/jsontext packages are stable and generally available in Go 1.27! [7]
Sources
- The Go Team source says: This is a surprising default, a potential security vulnerability, and a performance limitation. A new Go API for JSON
- The Go Team source says: Unfortunately, these problems are inherent consequences of the existing API, making them practically impossible to fix within the Go 1 compatibility promise. A new Go API for JSON
- The Go Team source says: Introducing a new, incompatible major version of a package is a heavy consideration. A new Go API for JSON
- The Go Team source says: If possible, we should try to fix the existing package. A new Go API for JSON
- The Go Team source says: While it is relatively easy to add new features, it is difficult to change existing features. A new Go API for JSON
- The Go Team source says: Generally, decoders have become stricter at rejecting ambiguous inputs, to reduce the chance that two implementations will have different (successful) interpretations of a particular JSON value. A new Go API for JSON
- The Go Team source says: After additional feedback and refinement, the new encoding/json/v2 and encoding/json/jsontext packages are stable and generally available in Go 1.27! A new Go API for JSON