Skip to content

ValidateJsonRawMessage fails for numbers #389

Open
@jfancher

Description

@jfancher

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-

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions