@@ -206,6 +206,7 @@ func newResponse(request *thrift_any.Any, data []byte) *thrift_any.Any {
206
206
func serialize (obj thrift.Struct , protoc * protocol.ProtocolStruct ) ([]byte , error ) {
207
207
switch protoc .GetStandard () {
208
208
case protocol .StandardProtocol_Custom :
209
+ return thrift .EncodeCompact (obj )
209
210
case protocol .StandardProtocol_Binary :
210
211
return thrift .EncodeBinary (obj )
211
212
case protocol .StandardProtocol_Compact :
@@ -214,9 +215,10 @@ func serialize(obj thrift.Struct, protoc *protocol.ProtocolStruct) ([]byte, erro
214
215
return thrift .EncodeCompactJSON (obj )
215
216
case protocol .StandardProtocol_SimpleJson :
216
217
return thrift .EncodeSimpleJSON (obj )
218
+ default :
219
+ // default value in case the protocol is unknown, as seen in the java implementation of conformance tests.
220
+ return thrift .EncodeCompact (obj )
217
221
}
218
- // default value in case the protocol is unknown, as seen in the java implementation of conformance tests.
219
- return thrift .EncodeCompact (obj )
220
222
}
221
223
222
224
// loadStruct loads a thrift.Struct from the typeRegistry for a given thrift.Any.
@@ -255,6 +257,7 @@ func deserialize(registry *typeRegistry, value *thrift_any.Any) (thrift.Struct,
255
257
protoc := getProtocol (value )
256
258
switch protoc .GetStandard () {
257
259
case protocol .StandardProtocol_Custom :
260
+ err = thrift .DecodeCompact (value .GetData (), obj )
258
261
case protocol .StandardProtocol_Binary :
259
262
err = thrift .DecodeBinary (value .GetData (), obj )
260
263
case protocol .StandardProtocol_Compact :
0 commit comments