-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[]byte marshaled to null #272
Comments
我也碰到这种情况了: 目前只能切换回自带的 "encoding/json" |
https://play.golang.org/p/nx9cyeks1ne shows that stdlib json encodes a nil slice as "null" but decodes https://play.golang.org/p/lOSZs9_fzAB corroborates that []int follows the same pattern @ash2k - in my experience, if you write the testcase for json-iterator that shows this behavioral difference, they will fix it :) The test case should be trivial. https://github.com/json-iterator/go/blob/master/type_tests/map_test.go I am not sure why it doesn't get caught already, truthfully. |
sorry for the delay, the base64 decode issue has been fixed |
I'm not sure this has been fixed:
|
I'm also seeing (For completeness, my example provides a nil byte array as well, which I would expect to be marshaled to "null".) Any chance of this getting addressed?
|
Fixed in #371 |
One of the fuzz tests in Kubernetes caught an issue:
This library:
encoding/json
:Notice how at the very end of the json the value in the map is not the same.
BinaryData field is declared like this:
https://github.com/kubernetes/kubernetes/blob/8f20a815e5ef27d4d247e42bff90e42706397ca2/staging/src/k8s.io/api/core/v1/types.go#L4742
Trying to migrate all
encoding/json
uses to this library in this PR kubernetes/kubernetes#63284This is using commit 2ddf6d7
The text was updated successfully, but these errors were encountered: