go
go copied to clipboard
A high-performance 100% compatible drop-in replacement of "encoding/json"
This PR fixes a bug in `Marshal` where it would panic when attempting to serialize self-referencing structs or slices. Previously, encountering these data structures would cause a panic, making it...
Describe the bug When unmarshaling into a pre-initialized map[string]any, if the input starts with the letter n, jsoniter.Unmarshal unexpectedly sets the map to nil. This happens even when the input...
package main import ( "log" json "github.com/json-iterator/go" ) // Implement interface type Address struct { City string State string Post string *Person } // Implement interface type Person struct {...
``` type TextStyle struct { FontFamily string `json:"fontFamily"` FontSize int32 `json:"fontSize"` TextAlign string `json:"textAlign"` TextColor string `json:"textColor"` FontStyle string `json:"fontStyle"` IsBold bool `json:"isBold"` IsItalic bool `json:"isItalic"` Underline string `json:"underline"` }...
As described in issue https://github.com/json-iterator/go/issues/696, cyclic dependencies between structs cause a stack overflow. In this PR, I have added a hasCycle(v) function to check an object for cycles before marshaling...
I need a way to treat sub-structs as if they are anonymously embedded when marshalling/unmarshalling to json. Is this possible with jsoniter extensions? Couldn't find any documentation on extensions. Please...
It seems jsoniter is not supporting `omitzero` tag from std and related `IsZero() bool` method. Is there any plans to support it ?