1
0
mirror of https://github.com/json-iterator/go.git synced 2024-11-30 08:36:43 +02:00
Commit Graph

593 Commits

Author SHA1 Message Date
Tao Wen
a9b9c73b4d fix #207 delay unsupported type error reporting 2017-12-15 10:13:11 +08:00
Tao Wen
e0df39fda2 fix #206, do not allow nil pointer as unmarshal input 2017-12-14 17:18:05 +08:00
Tao Wen
13f86432b8 do not use defer() in read int 2017-12-12 18:52:41 +08:00
Tao Wen
d2a7335211 fix #202 #203 #204 map encoder not proplery initialized 2017-12-08 21:18:59 +08:00
Tao Wen
b2a706d14b reverse last commit, need a better fix 2017-12-08 06:15:49 +08:00
Tao Wen
23078876c5 fix #203 consider MarshalJSON as non empty 2017-12-07 23:20:43 +08:00
Tao Wen
051434fab7 fix #198, use dep for vendoring 2017-11-30 10:42:24 +08:00
Tao Wen
be6688fc1a fix #200, do not use symbolic link in the code 2017-11-30 10:34:05 +08:00
Tao Wen
ff2b70c1db support config level extension 2017-11-23 00:09:35 +08:00
Tao Wen
f7279a603e fix out of range 2017-11-15 23:34:21 +08:00
Tao Wen
9f088cbcc4 fix #195 when decode float as int, report it clearly 2017-11-15 23:25:12 +08:00
Tao Wen
3c0e5762c4 fix #196 do not hard code 1 << 49 2017-11-15 23:15:31 +08:00
Tao Wen
d394a135a1 #197 fix place holder encoder to use EncodeInterface, WriteToStream is unsafe when the real encoder is unknown 2017-11-15 22:56:23 +08:00
Tao Wen
9fddff05f0 try to fix #194 with larger array 2017-11-11 08:31:44 +08:00
Tao Wen
b1b003864e expose OptionalEncoder&OptionalDecoder; add attachment to Stream&Iterator for customized decoder/encoder 2017-11-08 11:41:45 +08:00
Tao Wen
aed5a81f09 fix #190 handle empty input 2017-10-31 22:47:02 +08:00
Tao Wen
f1258b01aa fix #191 do not always assume the object field is simple string 2017-10-31 22:38:41 +08:00
Tao Wen
fbd210edfc Merge pull request #189 from ggaaooppeenngg/compatible-with-map
Fix standard compatiblility
2017-10-26 18:39:38 -05:00
Peng Gao
640251ab91 Fix standard compatiblility
Non-nil but empty map with omitempty should be ignored.

Signed-off-by: Peng Gao <peng.gao.dut@gmail.com>
2017-10-27 01:43:41 +08:00
Tao Wen
06b2a7cf1d Merge pull request #188 from ggaaooppeenngg/compatible
Fix standard compatiblility
2017-10-26 06:41:01 -05:00
Peng Gao
5fffb9b8f7 Fix standard compatiblility
Encode has trailing newline at the end.

Signed-off-by: Peng Gao <peng.gao.dut@gmail.com>
2017-10-26 15:15:36 +08:00
Tao Wen
7e3b776024 change jsoniter-sloppy to jsoniter_sloppy 2017-10-23 15:03:44 +08:00
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
5068c8baaf #183 limit error message size 2017-10-09 08:16:52 +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
Tao Wen
73c7bc881e fix #180, add missing methods to jsoniter.Number 2017-10-06 17:56:36 +08:00
Tao Wen
4de15a3a87 Merge pull request #182 from MOZGIII/patch-1
Used writeTwoBytes in Stream.WriteEmptyArray
2017-10-04 02:25:32 -05:00
MOZGIII
14b28b2226 Used writeTwoBytes in Stream.WriteEmptyArray 2017-10-03 22:14:36 +03:00
Tao Wen
abe3c4016b fix #179 2017-09-26 15:35:55 +08:00
Tao Wen
dbb1ef3f63 #177 flush buffer should check available again 2017-09-21 21:04:45 +08:00
Tao Wen
46b20bbbec #178 SkipAndReturnBytes should return copy of memory 2017-09-21 20:18:45 +08:00
Tao Wen
fdfe0b9a69 Merge branch 'olegshaldybin-skip-unexported-fields' 2017-09-19 10:06:59 +08:00
Tao Wen
faa3dcf46a do not report error when field is unexported 2017-09-19 10:06:34 +08:00
Oleg Shaldybin
1f58120d43 Always skip unexported fields when encoding
Skip creating encoders for unexported fields. They are not participating
in JSON marshaling anyway. This allows using unexported fields of
non-marshalable types in structs.

As a side-effect of this change it's no longer possible to marshal
unexported JSON fields by adding a custom type extenstion. It seems this
is desired behavior since it matches standard library and jsoniter
already disallows `json:"-"` fields from participating in custom
extensions.

Fixes #174.
2017-09-18 11:02:15 -07:00
Tao Wen
6ed27152e0 Update README.md 2017-09-17 16:07:42 +08:00
Tao Wen
3c298d8a76 Merge pull request #172 from olegshaldybin/more-stdlib-compat
Improve stdlib compatibility
2017-09-17 03:05:36 -05: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
Tao Wen
c463aa12c4 Merge pull request #173 from toffaletti/more-nil-interface-fixes
More nil interface fixes
2017-09-16 18:36:43 -05:00
Jason Toffaletti
b5d2607a6d replace should.Equal(nil, err) with should.NoError(err) 2017-09-16 16:30:04 -07:00
Jason Toffaletti
48cc4d965a improve test 2017-09-16 16:27:32 -07:00
Jason Toffaletti
c59c42fda0 fix decoding of nil non-empty interface 2017-09-16 16:24:55 -07:00
Jason Toffaletti
8324374402 add tests for decoding nil interfaces 2017-09-16 16:24:27 -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
Jason Toffaletti
2f7e5c8dd7 add failing tests for nil non-empty interfaces 2017-09-16 16:00:48 -07:00
Tao Wen
92772579dd Merge pull request #170 from olegshaldybin/marshal-enum-pointer
Fix custom marshaler for enum types
2017-09-15 09:08:45 -05: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
Tao Wen
eef35e549b Merge pull request #169 from toffaletti/fix-nil-interface
Fix handling of nil empty interface
2017-09-15 00:45:11 -05:00