6dad2de6cc
fix build
2018-01-04 17:18:16 +08:00
a9b9c73b4d
fix #207 delay unsupported type error reporting
2017-12-15 10:13:11 +08:00
9f088cbcc4
fix #195 when decode float as int, report it clearly
2017-11-15 23:25:12 +08:00
3c0e5762c4
fix #196 do not hard code 1 << 49
2017-11-15 23:15:31 +08:00
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
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
b5d2607a6d
replace should.Equal(nil, err) with should.NoError(err)
2017-09-16 16:30:04 -07:00
48cc4d965a
improve test
2017-09-16 16:27:32 -07:00
8324374402
add tests for decoding nil interfaces
2017-09-16 16:24:27 -07:00
2f7e5c8dd7
add failing tests for nil non-empty interfaces
2017-09-16 16:00:48 -07:00
e658f6597a
add failing test for handling of nil interface with omitempty
2017-09-14 20:44:42 -07:00
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
90574c5ca3
#166 support ValidateJsonRawMessage in ConfigCompatibleWithStandardLibrary
2017-09-14 23:54:40 +08:00
0828e559d0
#164 support interface{} with ptr
2017-09-09 08:45:57 +08:00
e066e54964
#135 verify 1e1 and 1.0e1 is handled same as std
2017-07-18 11:28:19 +08:00
f0487718f6
document public symbols
2017-07-09 16:09:23 +08:00
b74ffb2e03
import github.com/stretchr/testify/require
2017-07-07 09:13:25 +08:00
04eae11ba5
#91 fix one ptr embedded struct
2017-07-01 00:09:40 +08:00
e6c24947ee
array is just like struct, one element case special for interface{
2017-06-29 18:58:40 +08:00
84fa033353
#80 fix the case when embedded struct ptr is nil
2017-06-29 18:45:11 +08:00
dc44e85a86
#73 fix interface{} optimization for one ptr field struct and array
2017-06-26 22:37:24 +08:00
14588726a1
expose ValEncoder & ValDecoder
2017-06-20 08:08:59 +08:00
31afe6450e
add Api interface to allow save the frozen config
2017-06-19 13:43:22 +08:00
7a049ec79c
#60 support read interface{} as json.Number
2017-06-18 15:22:37 +08:00
b31b1301e2
#59 add ConfigFastest
2017-06-17 10:21:37 +08:00
5f22e50c89
#53 support escapeHtml
2017-06-15 23:55:04 +08:00
acddcf5bbf
#53 extract out config
2017-06-13 16:58:53 +08:00
84ad508437
#48 should return error if concrete tpye unknown
2017-06-09 17:06:27 +08:00
cfffa29c8a
gofmt
2017-06-06 23:27:00 +08:00
e36f926072
fix random go test failure
2017-06-02 17:34:40 +08:00
707ed3b091
support non empty interface
2017-05-27 00:36:21 +08:00
6880076b44
fix map[string]interface{} in struct
2017-02-03 18:44:54 +08:00
ce1a1f1e98
test reading into custom interface
2017-01-25 23:25:25 +08:00
f1c4dbde29
support map of interface{}
2017-01-25 22:43:57 +08:00
a57c8c6202
test array of interface
2017-01-09 21:00:01 +08:00