The Wayback Machine - https://web.archive.org/web/20201017053754/https://github.com/json-iterator/go/issues/389
Skip to content
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

ValidateJsonRawMessage fails for numbers #389

Open
jfancher opened this issue Jul 18, 2019 · 0 comments
Open

ValidateJsonRawMessage fails for numbers #389

jfancher opened this issue Jul 18, 2019 · 0 comments

Comments

@jfancher
Copy link

@jfancher jfancher commented Jul 18, 2019

This expression yields null for str:

var jsi = jsoniter.ConfigCompatibleWithStandardLibrary
str, err := jsi.Marshal(json.RawMessage(`1234`))

The issue seems to be with the ValidateJsonRawMessage flag, because it works as expected for a direct jsoniter.Marshal. This only seems to be a problem for numbers; all other data types I've tried are fine (including objects or arrays which contain numbers).

Reproducer: https://play.golang.org/p/RKEy97ZLrn-

AllenX2018 pushed a commit to AllenX2018/go that referenced this issue Jan 14, 2020
AllenX2018 added a commit that referenced this issue Feb 6, 2020
fix issue #389 #411
AllenX2018 pushed a commit to AllenX2018/go that referenced this issue Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.