[#122] protogen: Always marshal empty fields

This is how it was done previously:
a0a9b765f3/rpc/message/encoding.go (L31)

The tricky part is `[]byte` which is marshaled as `null` by easyjson
helper, but as `""` by protojson.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-10-07 15:00:16 +03:00
parent 3e705a3cbe
commit 29c522d5d8
20 changed files with 3574 additions and 4230 deletions

View file

@ -101,7 +101,6 @@ func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.OwnerId != nil {
if !first {
out.RawByte(',')
} else {
@ -111,7 +110,6 @@ func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -306,7 +304,6 @@ func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -316,9 +313,7 @@ func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -328,9 +323,7 @@ func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -340,7 +333,6 @@ func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -485,7 +477,6 @@ func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Balance != nil {
if !first {
out.RawByte(',')
} else {
@ -495,7 +486,6 @@ func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Balance.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -690,7 +680,6 @@ func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -700,9 +689,7 @@ func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -712,9 +699,7 @@ func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -724,7 +709,6 @@ func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

View file

@ -117,7 +117,6 @@ func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Value != 0 {
if !first {
out.RawByte(',')
} else {
@ -129,9 +128,7 @@ func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.Value, 10)
out.RawByte('"')
}
}
{
if x.Precision != 0 {
if !first {
out.RawByte(',')
} else {
@ -141,7 +138,6 @@ func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Precision)
}
}
out.RawByte('}')
}

View file

@ -355,7 +355,6 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.HeaderType != 0 {
if !first {
out.RawByte(',')
} else {
@ -370,9 +369,7 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if x.MatchType != 0 {
if !first {
out.RawByte(',')
} else {
@ -387,9 +384,7 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -399,9 +394,7 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Key)
}
}
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -411,7 +404,6 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Value)
}
}
out.RawByte('}')
}
@ -608,7 +600,6 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Role != 0 {
if !first {
out.RawByte(',')
} else {
@ -623,9 +614,7 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if len(x.Keys) != 0 {
if !first {
out.RawByte(',')
} else {
@ -638,11 +627,14 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) {
if i != 0 {
out.RawByte(',')
}
if x.Keys[i] != nil {
out.Base64Bytes(x.Keys[i])
} else {
out.String("")
}
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -870,7 +862,6 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Operation != 0 {
if !first {
out.RawByte(',')
} else {
@ -885,9 +876,7 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if x.Action != 0 {
if !first {
out.RawByte(',')
} else {
@ -902,9 +891,7 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if len(x.Filters) != 0 {
if !first {
out.RawByte(',')
} else {
@ -921,9 +908,7 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.Targets) != 0 {
if !first {
out.RawByte(',')
} else {
@ -940,7 +925,6 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -1185,7 +1169,6 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Version != nil {
if !first {
out.RawByte(',')
} else {
@ -1195,9 +1178,7 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
}
{
if x.ContainerId != nil {
if !first {
out.RawByte(',')
} else {
@ -1207,9 +1188,7 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
}
{
if len(x.Records) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1226,7 +1205,6 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -1415,7 +1393,6 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Exp != 0 {
if !first {
out.RawByte(',')
} else {
@ -1427,9 +1404,7 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10)
out.RawByte('"')
}
}
{
if x.Nbf != 0 {
if !first {
out.RawByte(',')
} else {
@ -1441,9 +1416,7 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10)
out.RawByte('"')
}
}
{
if x.Iat != 0 {
if !first {
out.RawByte(',')
} else {
@ -1455,7 +1428,6 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10)
out.RawByte('"')
}
}
out.RawByte('}')
}
@ -1647,7 +1619,6 @@ func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Target != nil {
if !first {
out.RawByte(',')
} else {
@ -1657,9 +1628,7 @@ func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Target.MarshalEasyJSON(out)
}
}
{
if len(x.Chains) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1676,7 +1645,6 @@ func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -1910,7 +1878,6 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.EaclTable != nil {
if !first {
out.RawByte(',')
} else {
@ -1920,9 +1887,7 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.EaclTable.MarshalEasyJSON(out)
}
}
{
if x.OwnerId != nil {
if !first {
out.RawByte(',')
} else {
@ -1932,9 +1897,7 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
}
{
if x.Lifetime != nil {
if !first {
out.RawByte(',')
} else {
@ -1944,9 +1907,7 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Lifetime.MarshalEasyJSON(out)
}
}
{
if x.AllowImpersonate {
if !first {
out.RawByte(',')
} else {
@ -1956,9 +1917,7 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Bool(x.AllowImpersonate)
}
}
{
if x.ApeOverride != nil {
if !first {
out.RawByte(',')
} else {
@ -1968,7 +1927,6 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ApeOverride.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2149,7 +2107,6 @@ func (x *BearerToken) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -2159,9 +2116,7 @@ func (x *BearerToken) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.Signature != nil {
if !first {
out.RawByte(',')
} else {
@ -2171,7 +2126,6 @@ func (x *BearerToken) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

View file

@ -158,7 +158,6 @@ func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Type != 0 {
if !first {
out.RawByte(',')
} else {
@ -173,9 +172,7 @@ func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if len(x.Name) != 0 {
if !first {
out.RawByte(',')
} else {
@ -185,7 +182,6 @@ func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Name)
}
}
out.RawByte('}')
}
@ -358,7 +354,6 @@ func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) {
switch xx := x.Kind.(type) {
case *Chain_Raw:
{
if len(xx.Raw) != 0 {
if !first {
out.RawByte(',')
} else {
@ -366,7 +361,10 @@ func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"raw\":"
out.RawString(prefix)
if xx.Raw != nil {
out.Base64Bytes(xx.Raw)
} else {
out.String("")
}
}
}

View file

@ -124,7 +124,6 @@ func (x *AddChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Target != nil {
if !first {
out.RawByte(',')
} else {
@ -134,9 +133,7 @@ func (x *AddChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Target.MarshalEasyJSON(out)
}
}
{
if x.Chain != nil {
if !first {
out.RawByte(',')
} else {
@ -146,7 +143,6 @@ func (x *AddChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Chain.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -348,7 +344,6 @@ func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -358,9 +353,7 @@ func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -370,9 +363,7 @@ func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -382,7 +373,6 @@ func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -524,7 +514,6 @@ func (x *AddChainResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.ChainId) != 0 {
if !first {
out.RawByte(',')
} else {
@ -532,7 +521,10 @@ func (x *AddChainResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"chainId\":"
out.RawString(prefix)
if x.ChainId != nil {
out.Base64Bytes(x.ChainId)
} else {
out.String("")
}
}
out.RawByte('}')
@ -728,7 +720,6 @@ func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -738,9 +729,7 @@ func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -750,9 +739,7 @@ func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -762,7 +749,6 @@ func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -927,7 +913,6 @@ func (x *RemoveChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Target != nil {
if !first {
out.RawByte(',')
} else {
@ -937,9 +922,7 @@ func (x *RemoveChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Target.MarshalEasyJSON(out)
}
}
{
if len(x.ChainId) != 0 {
if !first {
out.RawByte(',')
} else {
@ -947,7 +930,10 @@ func (x *RemoveChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"chainId\":"
out.RawString(prefix)
if x.ChainId != nil {
out.Base64Bytes(x.ChainId)
} else {
out.String("")
}
}
out.RawByte('}')
@ -1150,7 +1136,6 @@ func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1160,9 +1145,7 @@ func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1172,9 +1155,7 @@ func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1184,7 +1165,6 @@ func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1488,7 +1468,6 @@ func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1498,9 +1477,7 @@ func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1510,9 +1487,7 @@ func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1522,7 +1497,6 @@ func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1667,7 +1641,6 @@ func (x *ListChainsRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Target != nil {
if !first {
out.RawByte(',')
} else {
@ -1677,7 +1650,6 @@ func (x *ListChainsRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Target.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1872,7 +1844,6 @@ func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1882,9 +1853,7 @@ func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1894,9 +1863,7 @@ func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1906,7 +1873,6 @@ func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2054,7 +2020,6 @@ func (x *ListChainsResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Chains) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2071,7 +2036,6 @@ func (x *ListChainsResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -2273,7 +2237,6 @@ func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -2283,9 +2246,7 @@ func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -2295,9 +2256,7 @@ func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -2307,7 +2266,6 @@ func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

View file

@ -124,7 +124,6 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Container != nil {
if !first {
out.RawByte(',')
} else {
@ -134,9 +133,7 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Container.MarshalEasyJSON(out)
}
}
{
if x.Signature != nil {
if !first {
out.RawByte(',')
} else {
@ -146,7 +143,6 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -348,7 +344,6 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -358,9 +353,7 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -370,9 +363,7 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -382,7 +373,6 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -527,7 +517,6 @@ func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.ContainerId != nil {
if !first {
out.RawByte(',')
} else {
@ -537,7 +526,6 @@ func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -732,7 +720,6 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -742,9 +729,7 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -754,9 +739,7 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -766,7 +749,6 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -934,7 +916,6 @@ func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.ContainerId != nil {
if !first {
out.RawByte(',')
} else {
@ -944,9 +925,7 @@ func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
}
{
if x.Signature != nil {
if !first {
out.RawByte(',')
} else {
@ -956,7 +935,6 @@ func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1158,7 +1136,6 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1168,9 +1145,7 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1180,9 +1155,7 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1192,7 +1165,6 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1496,7 +1468,6 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1506,9 +1477,7 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1518,9 +1487,7 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1530,7 +1497,6 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1675,7 +1641,6 @@ func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.ContainerId != nil {
if !first {
out.RawByte(',')
} else {
@ -1685,7 +1650,6 @@ func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1880,7 +1844,6 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1890,9 +1853,7 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1902,9 +1863,7 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1914,7 +1873,6 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2105,7 +2063,6 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Container != nil {
if !first {
out.RawByte(',')
} else {
@ -2115,9 +2072,7 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Container.MarshalEasyJSON(out)
}
}
{
if x.Signature != nil {
if !first {
out.RawByte(',')
} else {
@ -2127,9 +2082,7 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
}
{
if x.SessionToken != nil {
if !first {
out.RawByte(',')
} else {
@ -2139,7 +2092,6 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.SessionToken.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2348,7 +2300,6 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -2358,9 +2309,7 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -2370,9 +2319,7 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -2382,7 +2329,6 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2527,7 +2473,6 @@ func (x *ListRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.OwnerId != nil {
if !first {
out.RawByte(',')
} else {
@ -2537,7 +2482,6 @@ func (x *ListRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2732,7 +2676,6 @@ func (x *ListRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -2742,9 +2685,7 @@ func (x *ListRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -2754,9 +2695,7 @@ func (x *ListRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -2766,7 +2705,6 @@ func (x *ListRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2914,7 +2852,6 @@ func (x *ListResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.ContainerIds) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2931,7 +2868,6 @@ func (x *ListResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -3133,7 +3069,6 @@ func (x *ListResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -3143,9 +3078,7 @@ func (x *ListResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -3155,9 +3088,7 @@ func (x *ListResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -3167,7 +3098,6 @@ func (x *ListResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

View file

@ -119,7 +119,6 @@ func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -129,9 +128,7 @@ func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Key)
}
}
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -141,7 +138,6 @@ func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Value)
}
}
out.RawByte('}')
}
@ -389,7 +385,6 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Version != nil {
if !first {
out.RawByte(',')
} else {
@ -399,9 +394,7 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
}
{
if x.OwnerId != nil {
if !first {
out.RawByte(',')
} else {
@ -411,9 +404,7 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
}
{
if len(x.Nonce) != 0 {
if !first {
out.RawByte(',')
} else {
@ -421,11 +412,13 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"nonce\":"
out.RawString(prefix)
if x.Nonce != nil {
out.Base64Bytes(x.Nonce)
} else {
out.String("")
}
}
{
if x.BasicAcl != 0 {
if !first {
out.RawByte(',')
} else {
@ -435,9 +428,7 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.BasicAcl)
}
}
{
if len(x.Attributes) != 0 {
if !first {
out.RawByte(',')
} else {
@ -454,9 +445,7 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if x.PlacementPolicy != nil {
if !first {
out.RawByte(',')
} else {
@ -466,7 +455,6 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.PlacementPolicy.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

View file

@ -103,7 +103,6 @@ func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Members) != 0 {
if !first {
out.RawByte(',')
} else {
@ -120,7 +119,6 @@ func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}

View file

@ -260,7 +260,6 @@ func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -270,9 +269,7 @@ func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -282,9 +279,7 @@ func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -294,7 +289,6 @@ func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -462,7 +456,6 @@ func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Version != nil {
if !first {
out.RawByte(',')
} else {
@ -472,9 +465,7 @@ func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
}
{
if x.NodeInfo != nil {
if !first {
out.RawByte(',')
} else {
@ -484,7 +475,6 @@ func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.NodeInfo.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -686,7 +676,6 @@ func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -696,9 +685,7 @@ func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -708,9 +695,7 @@ func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -720,7 +705,6 @@ func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1024,7 +1008,6 @@ func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1034,9 +1017,7 @@ func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1046,9 +1027,7 @@ func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1058,7 +1037,6 @@ func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1203,7 +1181,6 @@ func (x *NetworkInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.NetworkInfo != nil {
if !first {
out.RawByte(',')
} else {
@ -1213,7 +1190,6 @@ func (x *NetworkInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.NetworkInfo.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1408,7 +1384,6 @@ func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1418,9 +1393,7 @@ func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1430,9 +1403,7 @@ func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1442,7 +1413,6 @@ func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1746,7 +1716,6 @@ func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1756,9 +1725,7 @@ func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1768,9 +1735,7 @@ func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -1780,7 +1745,6 @@ func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1925,7 +1889,6 @@ func (x *NetmapSnapshotResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Netmap != nil {
if !first {
out.RawByte(',')
} else {
@ -1935,7 +1898,6 @@ func (x *NetmapSnapshotResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Netmap.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2130,7 +2092,6 @@ func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -2140,9 +2101,7 @@ func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -2152,9 +2111,7 @@ func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -2164,7 +2121,6 @@ func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

View file

@ -277,7 +277,6 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Name) != 0 {
if !first {
out.RawByte(',')
} else {
@ -287,9 +286,7 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Name)
}
}
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -299,9 +296,7 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Key)
}
}
{
if x.Op != 0 {
if !first {
out.RawByte(',')
} else {
@ -316,9 +311,7 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -328,9 +321,7 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Value)
}
}
{
if len(x.Filters) != 0 {
if !first {
out.RawByte(',')
} else {
@ -347,7 +338,6 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -602,7 +592,6 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Name) != 0 {
if !first {
out.RawByte(',')
} else {
@ -612,9 +601,7 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Name)
}
}
{
if x.Count != 0 {
if !first {
out.RawByte(',')
} else {
@ -624,9 +611,7 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Count)
}
}
{
if x.Clause != 0 {
if !first {
out.RawByte(',')
} else {
@ -641,9 +626,7 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if len(x.Attribute) != 0 {
if !first {
out.RawByte(',')
} else {
@ -653,9 +636,7 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Attribute)
}
}
{
if len(x.Filter) != 0 {
if !first {
out.RawByte(',')
} else {
@ -665,7 +646,6 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Filter)
}
}
out.RawByte('}')
}
@ -900,7 +880,6 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Count != 0 {
if !first {
out.RawByte(',')
} else {
@ -910,9 +889,7 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Count)
}
}
{
if len(x.Selector) != 0 {
if !first {
out.RawByte(',')
} else {
@ -922,9 +899,7 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Selector)
}
}
{
if x.EcDataCount != 0 {
if !first {
out.RawByte(',')
} else {
@ -934,9 +909,7 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.EcDataCount)
}
}
{
if x.EcParityCount != 0 {
if !first {
out.RawByte(',')
} else {
@ -946,7 +919,6 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.EcParityCount)
}
}
out.RawByte('}')
}
@ -1213,7 +1185,6 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Replicas) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1230,9 +1201,7 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if x.ContainerBackupFactor != 0 {
if !first {
out.RawByte(',')
} else {
@ -1242,9 +1211,7 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.ContainerBackupFactor)
}
}
{
if len(x.Selectors) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1261,9 +1228,7 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.Filters) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1280,9 +1245,7 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if x.Unique {
if !first {
out.RawByte(',')
} else {
@ -1292,7 +1255,6 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Bool(x.Unique)
}
}
out.RawByte('}')
}
@ -1553,7 +1515,6 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1563,9 +1524,7 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Key)
}
}
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1575,9 +1534,7 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Value)
}
}
{
if len(x.Parents) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1594,7 +1551,6 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -1806,7 +1762,6 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.PublicKey) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1814,11 +1769,13 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"publicKey\":"
out.RawString(prefix)
if x.PublicKey != nil {
out.Base64Bytes(x.PublicKey)
} else {
out.String("")
}
}
{
if len(x.Addresses) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1835,9 +1792,7 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.Attributes) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1854,9 +1809,7 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if x.State != 0 {
if !first {
out.RawByte(',')
} else {
@ -1871,7 +1824,6 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
out.RawByte('}')
}
@ -2073,7 +2025,6 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Epoch != 0 {
if !first {
out.RawByte(',')
} else {
@ -2085,9 +2036,7 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10)
out.RawByte('"')
}
}
{
if len(x.Nodes) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2104,7 +2053,6 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -2273,7 +2221,6 @@ func (x *NetworkConfig_Parameter) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2281,11 +2228,13 @@ func (x *NetworkConfig_Parameter) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"key\":"
out.RawString(prefix)
if x.Key != nil {
out.Base64Bytes(x.Key)
} else {
out.String("")
}
}
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2293,7 +2242,10 @@ func (x *NetworkConfig_Parameter) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
}
out.RawByte('}')
@ -2434,7 +2386,6 @@ func (x *NetworkConfig) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Parameters) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2451,7 +2402,6 @@ func (x *NetworkConfig) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -2649,7 +2599,6 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.CurrentEpoch != 0 {
if !first {
out.RawByte(',')
} else {
@ -2661,9 +2610,7 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CurrentEpoch, 10)
out.RawByte('"')
}
}
{
if x.MagicNumber != 0 {
if !first {
out.RawByte(',')
} else {
@ -2675,9 +2622,7 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10)
out.RawByte('"')
}
}
{
if x.MsPerBlock != 0 {
if !first {
out.RawByte(',')
} else {
@ -2689,9 +2634,7 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.MsPerBlock, 10)
out.RawByte('"')
}
}
{
if x.NetworkConfig != nil {
if !first {
out.RawByte(',')
} else {
@ -2701,7 +2644,6 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.NetworkConfig.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

File diff suppressed because it is too large Load diff

View file

@ -307,7 +307,6 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Version != nil {
if !first {
out.RawByte(',')
} else {
@ -317,9 +316,7 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
}
{
if x.CreationEpoch != 0 {
if !first {
out.RawByte(',')
} else {
@ -331,9 +328,7 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10)
out.RawByte('"')
}
}
{
if x.OwnerId != nil {
if !first {
out.RawByte(',')
} else {
@ -343,9 +338,7 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
}
{
if x.ObjectType != 0 {
if !first {
out.RawByte(',')
} else {
@ -360,9 +353,7 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if x.PayloadLength != 0 {
if !first {
out.RawByte(',')
} else {
@ -374,9 +365,7 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10)
out.RawByte('"')
}
}
{
if x.PayloadHash != nil {
if !first {
out.RawByte(',')
} else {
@ -386,9 +375,7 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.PayloadHash.MarshalEasyJSON(out)
}
}
{
if x.HomomorphicHash != nil {
if !first {
out.RawByte(',')
} else {
@ -398,7 +385,6 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.HomomorphicHash.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -617,7 +603,6 @@ func (x *Header_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -627,9 +612,7 @@ func (x *Header_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Key)
}
}
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -639,7 +622,6 @@ func (x *Header_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Value)
}
}
out.RawByte('}')
}
@ -890,7 +872,6 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Parent != nil {
if !first {
out.RawByte(',')
} else {
@ -900,9 +881,7 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Parent.MarshalEasyJSON(out)
}
}
{
if x.Previous != nil {
if !first {
out.RawByte(',')
} else {
@ -912,9 +891,7 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Previous.MarshalEasyJSON(out)
}
}
{
if x.ParentSignature != nil {
if !first {
out.RawByte(',')
} else {
@ -924,9 +901,7 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ParentSignature.MarshalEasyJSON(out)
}
}
{
if x.ParentHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -936,9 +911,7 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ParentHeader.MarshalEasyJSON(out)
}
}
{
if len(x.Children) != 0 {
if !first {
out.RawByte(',')
} else {
@ -955,9 +928,7 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.SplitId) != 0 {
if !first {
out.RawByte(',')
} else {
@ -965,7 +936,10 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"splitID\":"
out.RawString(prefix)
if x.SplitId != nil {
out.Base64Bytes(x.SplitId)
} else {
out.String("")
}
}
out.RawByte('}')
@ -1288,7 +1262,6 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Parent != nil {
if !first {
out.RawByte(',')
} else {
@ -1298,9 +1271,7 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Parent.MarshalEasyJSON(out)
}
}
{
if x.Index != 0 {
if !first {
out.RawByte(',')
} else {
@ -1310,9 +1281,7 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Index)
}
}
{
if x.Total != 0 {
if !first {
out.RawByte(',')
} else {
@ -1322,9 +1291,7 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Total)
}
}
{
if x.HeaderLength != 0 {
if !first {
out.RawByte(',')
} else {
@ -1334,9 +1301,7 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.HeaderLength)
}
}
{
if len(x.Header) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1344,11 +1309,13 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"header\":"
out.RawString(prefix)
if x.Header != nil {
out.Base64Bytes(x.Header)
} else {
out.String("")
}
}
{
if len(x.ParentSplitId) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1356,11 +1323,13 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"parentSplitID\":"
out.RawString(prefix)
if x.ParentSplitId != nil {
out.Base64Bytes(x.ParentSplitId)
} else {
out.String("")
}
}
{
if x.ParentSplitParentId != nil {
if !first {
out.RawByte(',')
} else {
@ -1370,9 +1339,7 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ParentSplitParentId.MarshalEasyJSON(out)
}
}
{
if len(x.ParentAttributes) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1389,7 +1356,6 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -1842,7 +1808,6 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Version != nil {
if !first {
out.RawByte(',')
} else {
@ -1852,9 +1817,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
}
{
if x.ContainerId != nil {
if !first {
out.RawByte(',')
} else {
@ -1864,9 +1827,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
}
{
if x.OwnerId != nil {
if !first {
out.RawByte(',')
} else {
@ -1876,9 +1837,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
}
{
if x.CreationEpoch != 0 {
if !first {
out.RawByte(',')
} else {
@ -1890,9 +1849,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10)
out.RawByte('"')
}
}
{
if x.PayloadLength != 0 {
if !first {
out.RawByte(',')
} else {
@ -1904,9 +1861,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10)
out.RawByte('"')
}
}
{
if x.PayloadHash != nil {
if !first {
out.RawByte(',')
} else {
@ -1916,9 +1871,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.PayloadHash.MarshalEasyJSON(out)
}
}
{
if x.ObjectType != 0 {
if !first {
out.RawByte(',')
} else {
@ -1933,9 +1886,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if x.HomomorphicHash != nil {
if !first {
out.RawByte(',')
} else {
@ -1945,9 +1896,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.HomomorphicHash.MarshalEasyJSON(out)
}
}
{
if x.SessionToken != nil {
if !first {
out.RawByte(',')
} else {
@ -1957,9 +1906,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.SessionToken.MarshalEasyJSON(out)
}
}
{
if len(x.Attributes) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1976,9 +1923,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if x.Split != nil {
if !first {
out.RawByte(',')
} else {
@ -1988,9 +1933,7 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Split.MarshalEasyJSON(out)
}
}
{
if x.Ec != nil {
if !first {
out.RawByte(',')
} else {
@ -2000,7 +1943,6 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Ec.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2310,7 +2252,6 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.ObjectId != nil {
if !first {
out.RawByte(',')
} else {
@ -2320,9 +2261,7 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ObjectId.MarshalEasyJSON(out)
}
}
{
if x.Signature != nil {
if !first {
out.RawByte(',')
} else {
@ -2332,9 +2271,7 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
}
{
if x.Header != nil {
if !first {
out.RawByte(',')
} else {
@ -2344,9 +2281,7 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Header.MarshalEasyJSON(out)
}
}
{
if len(x.Payload) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2354,7 +2289,10 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"payload\":"
out.RawString(prefix)
if x.Payload != nil {
out.Base64Bytes(x.Payload)
} else {
out.String("")
}
}
out.RawByte('}')
@ -2550,7 +2488,6 @@ func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.SplitId) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2558,11 +2495,13 @@ func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"splitId\":"
out.RawString(prefix)
if x.SplitId != nil {
out.Base64Bytes(x.SplitId)
} else {
out.String("")
}
}
{
if x.LastPart != nil {
if !first {
out.RawByte(',')
} else {
@ -2572,9 +2511,7 @@ func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.LastPart.MarshalEasyJSON(out)
}
}
{
if x.Link != nil {
if !first {
out.RawByte(',')
} else {
@ -2584,7 +2521,6 @@ func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Link.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2768,7 +2704,6 @@ func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Id != nil {
if !first {
out.RawByte(',')
} else {
@ -2778,9 +2713,7 @@ func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Id.MarshalEasyJSON(out)
}
}
{
if x.Index != 0 {
if !first {
out.RawByte(',')
} else {
@ -2790,9 +2723,7 @@ func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Index)
}
}
{
if x.Total != 0 {
if !first {
out.RawByte(',')
} else {
@ -2802,7 +2733,6 @@ func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Total)
}
}
out.RawByte('}')
}
@ -2964,7 +2894,6 @@ func (x *ECInfo) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Chunks) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2981,7 +2910,6 @@ func (x *ECInfo) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}

View file

@ -193,7 +193,6 @@ func (x *Address) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.ContainerId != nil {
if !first {
out.RawByte(',')
} else {
@ -203,9 +202,7 @@ func (x *Address) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
}
{
if x.ObjectId != nil {
if !first {
out.RawByte(',')
} else {
@ -215,7 +212,6 @@ func (x *Address) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ObjectId.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -350,7 +346,6 @@ func (x *ObjectID) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -358,7 +353,10 @@ func (x *ObjectID) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
}
out.RawByte('}')
@ -487,7 +485,6 @@ func (x *ContainerID) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -495,7 +492,10 @@ func (x *ContainerID) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
}
out.RawByte('}')
@ -624,7 +624,6 @@ func (x *OwnerID) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -632,7 +631,10 @@ func (x *OwnerID) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
}
out.RawByte('}')
@ -781,7 +783,6 @@ func (x *Version) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Major != 0 {
if !first {
out.RawByte(',')
} else {
@ -791,9 +792,7 @@ func (x *Version) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Major)
}
}
{
if x.Minor != 0 {
if !first {
out.RawByte(',')
} else {
@ -803,7 +802,6 @@ func (x *Version) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Minor)
}
}
out.RawByte('}')
}
@ -992,7 +990,6 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1000,11 +997,13 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"key\":"
out.RawString(prefix)
if x.Key != nil {
out.Base64Bytes(x.Key)
} else {
out.String("")
}
}
{
if len(x.Sign) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1012,11 +1011,13 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"signature\":"
out.RawString(prefix)
if x.Sign != nil {
out.Base64Bytes(x.Sign)
} else {
out.String("")
}
}
{
if x.Scheme != 0 {
if !first {
out.RawByte(',')
} else {
@ -1031,7 +1032,6 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
out.RawByte('}')
}
@ -1206,7 +1206,6 @@ func (x *SignatureRFC6979) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1214,11 +1213,13 @@ func (x *SignatureRFC6979) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"key\":"
out.RawString(prefix)
if x.Key != nil {
out.Base64Bytes(x.Key)
} else {
out.String("")
}
}
{
if len(x.Sign) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1226,7 +1227,10 @@ func (x *SignatureRFC6979) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"signature\":"
out.RawString(prefix)
if x.Sign != nil {
out.Base64Bytes(x.Sign)
} else {
out.String("")
}
}
out.RawByte('}')
@ -1381,7 +1385,6 @@ func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Type != 0 {
if !first {
out.RawByte(',')
} else {
@ -1396,9 +1399,7 @@ func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if len(x.Sum) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1406,7 +1407,10 @@ func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"sum\":"
out.RawString(prefix)
if x.Sum != nil {
out.Base64Bytes(x.Sum)
} else {
out.String("")
}
}
out.RawByte('}')

View file

@ -121,7 +121,6 @@ func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.OwnerId != nil {
if !first {
out.RawByte(',')
} else {
@ -131,9 +130,7 @@ func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
}
{
if x.Expiration != 0 {
if !first {
out.RawByte(',')
} else {
@ -145,7 +142,6 @@ func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Expiration, 10)
out.RawByte('"')
}
}
out.RawByte('}')
}
@ -354,7 +350,6 @@ func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -364,9 +359,7 @@ func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -376,9 +369,7 @@ func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -388,7 +379,6 @@ func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -550,7 +540,6 @@ func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Id) != 0 {
if !first {
out.RawByte(',')
} else {
@ -558,11 +547,13 @@ func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"id\":"
out.RawString(prefix)
if x.Id != nil {
out.Base64Bytes(x.Id)
} else {
out.String("")
}
}
{
if len(x.SessionKey) != 0 {
if !first {
out.RawByte(',')
} else {
@ -570,7 +561,10 @@ func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"sessionKey\":"
out.RawString(prefix)
if x.SessionKey != nil {
out.Base64Bytes(x.SessionKey)
} else {
out.String("")
}
}
out.RawByte('}')
@ -772,7 +766,6 @@ func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -782,9 +775,7 @@ func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.MetaHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -794,9 +785,7 @@ func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
}
{
if x.VerifyHeader != nil {
if !first {
out.RawByte(',')
} else {
@ -806,7 +795,6 @@ func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

View file

@ -182,7 +182,6 @@ func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Container != nil {
if !first {
out.RawByte(',')
} else {
@ -192,9 +191,7 @@ func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Container.MarshalEasyJSON(out)
}
}
{
if len(x.Objects) != 0 {
if !first {
out.RawByte(',')
} else {
@ -211,7 +208,6 @@ func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@ -376,7 +372,6 @@ func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Verb != 0 {
if !first {
out.RawByte(',')
} else {
@ -391,9 +386,7 @@ func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if x.Target != nil {
if !first {
out.RawByte(',')
} else {
@ -403,7 +396,6 @@ func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Target.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -634,7 +626,6 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Verb != 0 {
if !first {
out.RawByte(',')
} else {
@ -649,9 +640,7 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
{
if x.Wildcard {
if !first {
out.RawByte(',')
} else {
@ -661,9 +650,7 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Bool(x.Wildcard)
}
}
{
if x.ContainerId != nil {
if !first {
out.RawByte(',')
} else {
@ -673,7 +660,6 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -869,7 +855,6 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Exp != 0 {
if !first {
out.RawByte(',')
} else {
@ -881,9 +866,7 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10)
out.RawByte('"')
}
}
{
if x.Nbf != 0 {
if !first {
out.RawByte(',')
} else {
@ -895,9 +878,7 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10)
out.RawByte('"')
}
}
{
if x.Iat != 0 {
if !first {
out.RawByte(',')
} else {
@ -909,7 +890,6 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10)
out.RawByte('"')
}
}
out.RawByte('}')
}
@ -1202,7 +1182,6 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Id) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1210,11 +1189,13 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"id\":"
out.RawString(prefix)
if x.Id != nil {
out.Base64Bytes(x.Id)
} else {
out.String("")
}
}
{
if x.OwnerId != nil {
if !first {
out.RawByte(',')
} else {
@ -1224,9 +1205,7 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
}
{
if x.Lifetime != nil {
if !first {
out.RawByte(',')
} else {
@ -1236,9 +1215,7 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Lifetime.MarshalEasyJSON(out)
}
}
{
if len(x.SessionKey) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1246,13 +1223,15 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"sessionKey\":"
out.RawString(prefix)
if x.SessionKey != nil {
out.Base64Bytes(x.SessionKey)
} else {
out.String("")
}
}
switch xx := x.Context.(type) {
case *SessionToken_Body_Object:
{
if xx.Object != nil {
if !first {
out.RawByte(',')
} else {
@ -1262,10 +1241,8 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
xx.Object.MarshalEasyJSON(out)
}
}
case *SessionToken_Body_Container:
{
if xx.Container != nil {
if !first {
out.RawByte(',')
} else {
@ -1276,7 +1253,6 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
xx.Container.MarshalEasyJSON(out)
}
}
}
out.RawByte('}')
}
@ -1483,7 +1459,6 @@ func (x *SessionToken) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Body != nil {
if !first {
out.RawByte(',')
} else {
@ -1493,9 +1468,7 @@ func (x *SessionToken) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
}
{
if x.Signature != nil {
if !first {
out.RawByte(',')
} else {
@ -1505,7 +1478,6 @@ func (x *SessionToken) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -1660,7 +1632,6 @@ func (x *XHeader) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.Key) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1670,9 +1641,7 @@ func (x *XHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Key)
}
}
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1682,7 +1651,6 @@ func (x *XHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Value)
}
}
out.RawByte('}')
}
@ -1973,7 +1941,6 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Version != nil {
if !first {
out.RawByte(',')
} else {
@ -1983,9 +1950,7 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
}
{
if x.Epoch != 0 {
if !first {
out.RawByte(',')
} else {
@ -1997,9 +1962,7 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10)
out.RawByte('"')
}
}
{
if x.Ttl != 0 {
if !first {
out.RawByte(',')
} else {
@ -2009,9 +1972,7 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Ttl)
}
}
{
if len(x.XHeaders) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2028,9 +1989,7 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if x.SessionToken != nil {
if !first {
out.RawByte(',')
} else {
@ -2040,9 +1999,7 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.SessionToken.MarshalEasyJSON(out)
}
}
{
if x.BearerToken != nil {
if !first {
out.RawByte(',')
} else {
@ -2052,9 +2009,7 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.BearerToken.MarshalEasyJSON(out)
}
}
{
if x.Origin != nil {
if !first {
out.RawByte(',')
} else {
@ -2064,9 +2019,7 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Origin.MarshalEasyJSON(out)
}
}
{
if x.MagicNumber != 0 {
if !first {
out.RawByte(',')
} else {
@ -2078,7 +2031,6 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10)
out.RawByte('"')
}
}
out.RawByte('}')
}
@ -2398,7 +2350,6 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Version != nil {
if !first {
out.RawByte(',')
} else {
@ -2408,9 +2359,7 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
}
{
if x.Epoch != 0 {
if !first {
out.RawByte(',')
} else {
@ -2422,9 +2371,7 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10)
out.RawByte('"')
}
}
{
if x.Ttl != 0 {
if !first {
out.RawByte(',')
} else {
@ -2434,9 +2381,7 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Ttl)
}
}
{
if len(x.XHeaders) != 0 {
if !first {
out.RawByte(',')
} else {
@ -2453,9 +2398,7 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if x.Origin != nil {
if !first {
out.RawByte(',')
} else {
@ -2465,9 +2408,7 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Origin.MarshalEasyJSON(out)
}
}
{
if x.Status != nil {
if !first {
out.RawByte(',')
} else {
@ -2477,7 +2418,6 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Status.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -2733,7 +2673,6 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.BodySignature != nil {
if !first {
out.RawByte(',')
} else {
@ -2743,9 +2682,7 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.BodySignature.MarshalEasyJSON(out)
}
}
{
if x.MetaSignature != nil {
if !first {
out.RawByte(',')
} else {
@ -2755,9 +2692,7 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaSignature.MarshalEasyJSON(out)
}
}
{
if x.OriginSignature != nil {
if !first {
out.RawByte(',')
} else {
@ -2767,9 +2702,7 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OriginSignature.MarshalEasyJSON(out)
}
}
{
if x.Origin != nil {
if !first {
out.RawByte(',')
} else {
@ -2779,7 +2712,6 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Origin.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
@ -3000,7 +2932,6 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.BodySignature != nil {
if !first {
out.RawByte(',')
} else {
@ -3010,9 +2941,7 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.BodySignature.MarshalEasyJSON(out)
}
}
{
if x.MetaSignature != nil {
if !first {
out.RawByte(',')
} else {
@ -3022,9 +2951,7 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.MetaSignature.MarshalEasyJSON(out)
}
}
{
if x.OriginSignature != nil {
if !first {
out.RawByte(',')
} else {
@ -3034,9 +2961,7 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.OriginSignature.MarshalEasyJSON(out)
}
}
{
if x.Origin != nil {
if !first {
out.RawByte(',')
} else {
@ -3046,7 +2971,6 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
x.Origin.MarshalEasyJSON(out)
}
}
out.RawByte('}')
}

View file

@ -371,7 +371,6 @@ func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Id != 0 {
if !first {
out.RawByte(',')
} else {
@ -381,9 +380,7 @@ func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Id)
}
}
{
if len(x.Value) != 0 {
if !first {
out.RawByte(',')
} else {
@ -391,7 +388,10 @@ func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
}
out.RawByte('}')
@ -580,7 +580,6 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.Code != 0 {
if !first {
out.RawByte(',')
} else {
@ -590,9 +589,7 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.Code)
}
}
{
if len(x.Message) != 0 {
if !first {
out.RawByte(',')
} else {
@ -602,9 +599,7 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.Message)
}
}
{
if len(x.Details) != 0 {
if !first {
out.RawByte(',')
} else {
@ -621,7 +616,6 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}

View file

@ -144,7 +144,6 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.ExpirationEpoch != 0 {
if !first {
out.RawByte(',')
} else {
@ -156,9 +155,7 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.ExpirationEpoch, 10)
out.RawByte('"')
}
}
{
if len(x.SplitId) != 0 {
if !first {
out.RawByte(',')
} else {
@ -166,11 +163,13 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"splitID\":"
out.RawString(prefix)
if x.SplitId != nil {
out.Base64Bytes(x.SplitId)
} else {
out.String("")
}
}
{
if len(x.Members) != 0 {
if !first {
out.RawByte(',')
} else {
@ -187,7 +186,6 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}

View file

@ -26,12 +26,38 @@ func nonZero[T protoInt]() T {
func TestStableMarshalSingle(t *testing.T) {
t.Run("empty", func(t *testing.T) {
t.Run("proto", func(t *testing.T) {
input := &generated.Primitives{}
require.Zero(t, input.StableSize())
r := input.MarshalProtobuf(nil)
require.Empty(t, r)
})
t.Run("json", func(t *testing.T) {
input := &generated.Primitives{}
r, err := input.MarshalJSON()
require.NoError(t, err)
require.NotEmpty(t, r)
var actual test.Primitives
require.NoError(t, protojson.Unmarshal(r, &actual))
t.Run("protojson compatibility", func(t *testing.T) {
data, err := protojson.MarshalOptions{EmitUnpopulated: true}.Marshal(&actual)
require.NoError(t, err)
require.JSONEq(t, string(data), string(r))
})
var actualFrostfs generated.Primitives
require.NoError(t, actualFrostfs.UnmarshalJSON(r))
if len(actualFrostfs.FieldA) == 0 {
actualFrostfs.FieldA = nil
}
require.Equal(t, input, &actualFrostfs)
primitivesEqual(t, input, &actual)
})
})
marshalCases := []struct {
name string
@ -77,13 +103,16 @@ func TestStableMarshalSingle(t *testing.T) {
require.NoError(t, protojson.Unmarshal(r, &actual))
t.Run("protojson compatibility", func(t *testing.T) {
data, err := protojson.Marshal(&actual)
data, err := protojson.MarshalOptions{EmitUnpopulated: true}.Marshal(&actual)
require.NoError(t, err)
require.JSONEq(t, string(data), string(r))
})
var actualFrostfs generated.Primitives
require.NoError(t, actualFrostfs.UnmarshalJSON(r))
if len(actualFrostfs.FieldA) == 0 {
actualFrostfs.FieldA = nil
}
require.Equal(t, tc.input, &actualFrostfs)
primitivesEqual(t, tc.input, &actual)
@ -94,7 +123,10 @@ func TestStableMarshalSingle(t *testing.T) {
func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) {
// Compare each field directly, because proto-generated code has private fields.
require.Equal(t, len(a.FieldA), len(b.FieldA))
if len(a.FieldA) != 0 {
require.Equal(t, a.FieldA, b.FieldA)
}
require.Equal(t, a.FieldB, b.FieldB)
require.Equal(t, a.FieldC, b.FieldC)
require.Equal(t, a.FieldD, b.FieldD)

View file

@ -133,7 +133,6 @@ func (x *Primitives_Aux) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.InnerField != 0 {
if !first {
out.RawByte(',')
} else {
@ -143,7 +142,6 @@ func (x *Primitives_Aux) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.InnerField)
}
}
out.RawByte('}')
}
@ -579,7 +577,6 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.FieldA) != 0 {
if !first {
out.RawByte(',')
} else {
@ -587,11 +584,13 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"fieldA\":"
out.RawString(prefix)
if x.FieldA != nil {
out.Base64Bytes(x.FieldA)
} else {
out.String("")
}
}
{
if len(x.FieldB) != 0 {
if !first {
out.RawByte(',')
} else {
@ -601,9 +600,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.String(x.FieldB)
}
}
{
if x.FieldC {
if !first {
out.RawByte(',')
} else {
@ -613,9 +610,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Bool(x.FieldC)
}
}
{
if x.FieldD != 0 {
if !first {
out.RawByte(',')
} else {
@ -625,9 +620,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Int32(x.FieldD)
}
}
{
if x.FieldE != 0 {
if !first {
out.RawByte(',')
} else {
@ -637,9 +630,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.FieldE)
}
}
{
if x.FieldF != 0 {
if !first {
out.RawByte(',')
} else {
@ -651,9 +642,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldF, 10)
out.RawByte('"')
}
}
{
if x.FieldG != 0 {
if !first {
out.RawByte(',')
} else {
@ -665,9 +654,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldG, 10)
out.RawByte('"')
}
}
{
if x.FieldI != 0 {
if !first {
out.RawByte(',')
} else {
@ -679,9 +666,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldI, 10)
out.RawByte('"')
}
}
{
if x.FieldJ != 0 {
if !first {
out.RawByte(',')
} else {
@ -691,9 +676,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Float64(x.FieldJ)
}
}
{
if x.FieldK != 0 {
if !first {
out.RawByte(',')
} else {
@ -703,9 +686,7 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.FieldK)
}
}
{
if x.FieldH != 0 {
if !first {
out.RawByte(',')
} else {
@ -720,11 +701,9 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.Int32(v)
}
}
}
switch xx := x.FieldM.(type) {
case *Primitives_FieldMa:
{
if len(xx.FieldMa) != 0 {
if !first {
out.RawByte(',')
} else {
@ -732,12 +711,14 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
}
const prefix string = "\"fieldMa\":"
out.RawString(prefix)
if xx.FieldMa != nil {
out.Base64Bytes(xx.FieldMa)
} else {
out.String("")
}
}
case *Primitives_FieldMe:
{
if xx.FieldMe != 0 {
if !first {
out.RawByte(',')
} else {
@ -747,10 +728,8 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(xx.FieldMe)
}
}
case *Primitives_FieldAux:
{
if xx.FieldAux != nil {
if !first {
out.RawByte(',')
} else {
@ -761,7 +740,6 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
xx.FieldAux.MarshalEasyJSON(out)
}
}
}
out.RawByte('}')
}
@ -1067,7 +1045,6 @@ func (x *RepPrimitives_Aux) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if x.InnerField != 0 {
if !first {
out.RawByte(',')
} else {
@ -1077,7 +1054,6 @@ func (x *RepPrimitives_Aux) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString(prefix)
out.Uint32(x.InnerField)
}
}
out.RawByte('}')
}
@ -1365,7 +1341,6 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
first := true
out.RawByte('{')
{
if len(x.FieldA) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1378,13 +1353,15 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
if i != 0 {
out.RawByte(',')
}
if x.FieldA[i] != nil {
out.Base64Bytes(x.FieldA[i])
} else {
out.String("")
}
}
out.RawByte(']')
}
}
{
if len(x.FieldB) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1401,9 +1378,7 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.FieldC) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1420,9 +1395,7 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.FieldD) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1439,9 +1412,7 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.FieldE) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1460,9 +1431,7 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.FieldF) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1481,9 +1450,7 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.FieldFu) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1502,9 +1469,7 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
{
if len(x.FieldAux) != 0 {
if !first {
out.RawByte(',')
} else {
@ -1521,7 +1486,6 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
}
out.RawByte(']')
}
}
out.RawByte('}')
}

View file

@ -192,14 +192,17 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin
selector := name + "." + f.GoName
isNotDefault := notNil
if f.Desc.IsList() {
isNotDefault = notEmpty
} else if f.Desc.Kind() != protoreflect.MessageKind {
_, isNotDefault = easyprotoKindInfo(f.Desc.Kind())
}
g.P("if ", isNotDefault(selector), "{")
defer g.P("}")
// This code is responsible for ignoring default values.
// We will restore it after having parametrized JSON marshaling.
//
// isNotDefault := notNil
// if f.Desc.IsList() {
// isNotDefault = notEmpty
// } else if f.Desc.Kind() != protoreflect.MessageKind {
// _, isNotDefault = easyprotoKindInfo(f.Desc.Kind())
// }
// g.P("if ", isNotDefault(selector), "{")
// defer g.P("}")
g.P("if !first { out.RawByte(','); } else { first = false; }")
g.P("const prefix string = ", `"\"`, fieldJSONName(f), `\":"`)
@ -247,7 +250,10 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin
case protoreflect.StringKind:
template = "out.String(%s)"
case protoreflect.BytesKind:
template = "out.Base64Bytes(%s)"
g.P("if ", selector, "!= nil {")
g.P("out.Base64Bytes(", selector, ")")
g.P("} else { out.String(\"\") }")
return
case protoreflect.MessageKind:
template = "%s.MarshalEasyJSON(out)"
case protoreflect.GroupKind: