Skip to content

ValidateJsonRawMessage fails for numbers #389

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

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

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-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant