1
0
mirror of https://github.com/json-iterator/go.git synced 2025-01-23 18:54:21 +02:00

50 Commits

Author SHA1 Message Date
Tao Wen
6240e1e798 #185 add jsoniter.Valid 2017-10-10 08:57:02 +08:00
Tao Wen
0149a5cf4a fix #183 error message not only show expectation, but also the actual value 2017-10-09 08:24:51 +08:00
Tao Wen
16f78601b5 fix #184, support null as number 2017-10-07 09:29:32 +08:00
Tao Wen
8f50a91be2 fix #181, support string as json.Number and jsoniter.Number 2017-10-06 18:08:14 +08:00
Oleg Shaldybin
9f6e5962a9 Improve stdlib compatibility
1. Null values for primitive types no longer clear the original value in
the destination object.

2. Dereference multiple levels of pointers in the destination interface{}
type before unmarshaling into it. This is needed to match stdlib
behavior when working with nested interface{} fields. If the destination
object is a pointer to interface{} then the incoming nil value should
nil out the destination object but keep the reference to that nil value
on its parent object. However if the destination object is an
interface{} value it should set the reference to nil but keep the
original object intact.

3. Correctly handle typed nil decode destinations.
2017-09-16 16:57:51 -07:00
Jason Toffaletti
c59c42fda0 fix decoding of nil non-empty interface 2017-09-16 16:24:55 -07:00
Jason Toffaletti
2017f3866b fix encoding of nil marshaler interface 2017-09-16 16:08:32 -07:00
Jason Toffaletti
ddc5af4512 fix encoding of nil non-empty interface 2017-09-16 16:04:36 -07:00
Oleg Shaldybin
ae57d167e8 Fix custom marshaler for enum types
When MarshalJSON was defined on a pointer receiver custom enum type
marshaling/unmarshaling was panicing since the underlying primitive type
was treated as a pointer.

Since method set for pointer receivers includes value receiver methods
we don't really need optionalEncoder and can just use marshalEncoder
directly.
2017-09-14 23:26:12 -07:00
Jason Toffaletti
005d86dc44 fix handling of nil empty interface 2017-09-14 21:32:42 -07:00
Oleg Shaldybin
18a241d40b Allow null booleans
Make sure we do the same thing as stdlib with null booleans by not
touching the original value and discarding the null.

Another somewhat related change is nulling out null interface values in
the original structure. This also matches stdlib behavior.
2017-09-14 16:47:35 -07:00
Tao Wen
90574c5ca3 #166 support ValidateJsonRawMessage in ConfigCompatibleWithStandardLibrary 2017-09-14 23:54:40 +08:00
Tao Wen
0828e559d0 #164 support interface{} with ptr 2017-09-09 08:45:57 +08:00
Tao Wen
db32ee8c2d #157 number can be null 2017-09-05 13:00:03 +08:00
Tao Wen
1cfa233923 #143 make jsoniter.Number same meaning as json.Number, however UseNumber still returns json.Number. 1.9 alias support should be added later 2017-08-05 07:22:53 +08:00
Tao Wen
d249b05a85 rename ValueType, to avoid collision with json.Number 2017-08-05 07:10:15 +08:00
Tao Wen
c15b4d116c #139 unmarshal non base64 into []byte 2017-07-19 12:04:22 +08:00
Tao Wen
3a6ecf051c make receiver names consistent 2017-07-09 15:11:24 +08:00
Tao Wen
ed6c434851 gofmt 2017-07-02 11:56:01 +08:00
Tao Wen
54ab168362 #99 support uintptr 2017-07-02 11:03:13 +08:00
Tao Wen
f2c50ef73b #97 omit empty behavior should follow the original type 2017-07-02 00:41:23 +08:00
Tao Wen
fa0965a968 #90 trim spaces when UnmarshalJSON 2017-07-01 00:33:42 +08:00
Tao Wen
1253b8edd3 gofmt 2017-06-29 20:40:25 +08:00
Tao Wen
545a32f2a1 #76 support TextUnmarshal 2017-06-29 00:14:55 +08:00
Tao Wen
faaa59222a #79 fix string tag on string field 2017-06-28 23:37:10 +08:00
Tao Wen
cf77980493 #71 fixed []byte alias 2017-06-26 14:25:56 +08:00
Tao Wen
486534c67c #67 time as int64 2017-06-20 17:43:47 +08:00
Tao Wen
818ae1331a #68 number to string 2017-06-20 15:11:01 +08:00
Tao Wen
b3170a8cef rename Encoder => ValEncoder and Decoder => ValDecoder 2017-06-20 07:59:45 +08:00
Tao Wen
945fe53724 fix html escape test and omit empty 2017-06-20 07:46:13 +08:00
Tao Wen
c6a598e292 # add jsoniter.RawMessage 2017-06-19 23:10:20 +08:00
Tao Wen
3d5f6d3a4a #58 string mode support both encoding and decoding 2017-06-17 11:38:09 +08:00
Tao Wen
84ad508437 #48 should return error if concrete tpye unknown 2017-06-09 17:06:27 +08:00
Tao Wen
cfffa29c8a gofmt 2017-06-06 23:27:00 +08:00
Tao Wen
a4e5abf492 support []byte; marshal without copy 2017-06-06 09:44:56 +08:00
Tao Wen
fe9fa8900e #31 support json.RawMessage 2017-06-02 10:50:23 +08:00
Tao Wen
ad3a7fde32 #30 support json.Number 2017-06-02 10:21:43 +08:00
Tao Wen
707ed3b091 support non empty interface 2017-05-27 00:36:21 +08:00
Tao Wen
7d2ae80c37 #27 support json.Unmarshaler 2017-05-24 16:04:11 +08:00
Tao Wen
f6f159e108 #27 support json.Marshaler 2017-05-24 14:34:00 +08:00
Tao Wen
5488fde97f fix one field struct interface{} optimization compatibility 2017-05-23 17:44:50 +08:00
Tao Wen
d1aa59e34e #12 implement omitempty 2017-03-08 07:38:25 -08:00
Tao Wen
6880076b44 fix map[string]interface{} in struct 2017-02-03 18:44:54 +08:00
Tao Wen
9b587c0f22 suport encode interface 2017-01-26 00:25:17 +08:00
Tao Wen
f1c4dbde29 support map of interface{} 2017-01-25 22:43:57 +08:00
Tao Wen
9df37bbd68 remove any 2017-01-22 19:36:19 +08:00
Tao Wen
a57c8c6202 test array of interface 2017-01-09 21:00:01 +08:00
Tao Wen
552afb3625 struct encoder 2017-01-09 19:19:48 +08:00
Tao Wen
5b0609f901 support int/string encode 2017-01-09 17:47:21 +08:00
Tao Wen
101dfdbb2a fix 4 fields object decoding 2017-01-06 20:17:47 +08:00