Commit graph

573 commits

Author SHA1 Message Date
jwilson
af6ff5e6e3 Example adapter that recovers from JsonDataExceptions. 2017-02-02 23:24:08 -05:00
Jesse Wilson
81aed974c6 Merge pull request #247 from square/jwilson.0202.rename_teh_things
Rename toJsonObject() to toJsonValue(), fromJsonObject() to fromJsonV…
2017-02-02 22:06:15 -05:00
jwilson
e9d8538ec3 Rename toJsonObject() to toJsonValue(), fromJsonObject() to fromJsonValue().
Also rename the JsonReader and JsonWriter implementations.
2017-02-02 21:28:38 -05:00
Jesse Wilson
5b5a1a6b9b Merge pull request #236 from NightlyNexus/eric/factory-samples
Add Unwrap JsonAdapter.Factory sample
2017-02-02 09:12:06 -05:00
Jesse Wilson
3af58f4a43 Merge pull request #245 from NightlyNexus/eric/platform-fields
Fix isPlatformType
2017-02-02 09:10:45 -05:00
Jesse Wilson
cf087753ff Merge pull request #246 from square/jwilson.0202.numbers_ii
Use BigDecimal to encode exotic number types.
2017-02-02 08:27:47 -05:00
jwilson
fdaecb9fb8 Use BigDecimal to encode exotic number types.
Previously we'd retain whatever types the caller passed in. This was
potentially problematic for non-immutable numeric types like AtomicInteger.
2017-02-02 08:27:07 -05:00
Eric Cochran
9420b6493c Fix isPlatformType
createFieldBindings should not take the allowed platform types into
account.
2017-02-01 18:37:44 -08:00
Eric Cochran
832ae4b34f Add Unwrap JsonAdapter.Factory sample 2017-01-31 18:24:42 -08:00
Jesse Wilson
3c23da50cf Merge pull request #242 from NightlyNexus/eric/nextAnnotations
Add Types.nextAnnotations
2017-01-31 21:08:14 -05:00
Jesse Wilson
ace5979fcf Merge pull request #243 from NightlyNexus/eric/duplicate-key-tests
Add tests for duplicate JSON keys
2017-01-31 21:05:17 -05:00
Eric Cochran
9417cd8207 Add tests for duplicate JSON keys 2017-01-31 14:44:17 -08:00
Eric Cochran
05b594a26c Add Types.nextAnnotations 2017-01-31 11:18:13 -08:00
Jesse Wilson
ac325c0c68 Merge pull request #241 from NightlyNexus/eric/types-tests
Add arrayOf, subtypeOf, supertypeOf tests
2017-01-31 08:05:54 -05:00
Eric Cochran
6a2981108f Add arrayOf, subtypeOf, supertypeOf tests 2017-01-30 23:03:20 -08:00
Jesse Wilson
ed164fd806 Merge pull request #235 from NightlyNexus/master
Improve error message for qualified platform types
2017-01-30 20:56:34 -05:00
Jesse Wilson
14a430cb58 Merge pull request #237 from NightlyNexus/patch-1
Add Types.createJsonQualifierImplementation
2017-01-30 20:55:00 -05:00
Eric Cochran
d27eaa161a Add adapter(Type, Class<? extends Annotation>) 2017-01-30 11:19:40 -08:00
Jake Wharton
7b39133748 Merge pull request #240 from square/jwilson.0129.promote_value_to_name
Implement promoteValueToName() for ObjectJsonWriter.
2017-01-29 23:01:46 -05:00
jwilson
75b549f1ff Implement promoteValueToName() for ObjectJsonWriter.
This was renamed from promoteNameToValue(). Also run the test on both types of
codecs and fix some implementation issues that uncovered.
2017-01-29 22:47:59 -05:00
Jake Wharton
b4367899cd Merge pull request #238 from square/jwilson.0129.serializeNulls
New JsonAdapter.serializeNulls() method.
2017-01-29 22:25:39 -05:00
jwilson
b338d1e7ed New JsonAdapter.serializeNulls() method.
This makes it possible to force nulls into the document without
much fuss.
2017-01-29 22:18:12 -05:00
Eric Cochran
99c1cd0ffd Improve error message for qualified platform types 2017-01-28 16:47:22 -08:00
Jesse Wilson
99479682ba Merge pull request #233 from square/jwilson.0124.promote_stacks
Promote stack management to the JsonReader/JsonWriter supertypes.
2017-01-25 22:26:30 -05:00
jwilson
4b7ced70e4 Promote stack management to the JsonReader/JsonWriter supertypes.
It turns out that we can reuse a lot of code with inheritance. Who knew?
2017-01-25 22:25:19 -05:00
Jake Wharton
a2908369ac Merge pull request #234 from square/jwilson.0124.toJsonObject
New APIs: JsonAdapter.toJsonObject, fromJsonObject.
2017-01-24 22:35:09 -05:00
jwilson
e54b023991 New APIs: JsonAdapter.toJsonObject, fromJsonObject.
https://github.com/square/moshi/issues/89
2017-01-24 22:11:31 -05:00
Jake Wharton
a90b6c7740 Merge pull request #232 from square/jwilson.0123.object_json_writer
Implement ObjectJsonWriter.
2017-01-24 12:04:41 -05:00
jwilson
5ca491fe50 Implement ObjectJsonWriter.
https://github.com/square/moshi/issues/89
2017-01-23 20:46:35 -05:00
Jake Wharton
3f06c0cf55 Merge pull request #228 from square/jwilson.0122.json_writer_tests
Prepare tests for a 2nd implementation of JsonWriter.
2017-01-23 17:32:44 -05:00
Jesse Wilson
9cb5cb8699 Merge pull request #231 from serj-lotutovici/sl/small_or_nit
ObjectJsonReader.typeMismatch should return not throw.
2017-01-22 18:52:54 -05:00
Serj Lotutovici
ed6c3a66b0 ObjectJsonReader.typeMismatch should return not throw. 2017-01-23 00:12:11 +01:00
Jesse Wilson
050b9affbc Merge pull request #230 from serj-lotutovici/sl/no_loop_if_buf
Avoid calling source.select() if the value is buffered.
2017-01-22 18:00:21 -05:00
Jesse Wilson
5a12b31439 Merge pull request #229 from serj-lotutovici/sl/use_select_only
Class and Enum adapters now rely only on Options.
2017-01-22 17:58:06 -05:00
Serj Lotutovici
ddf2489910 Avoid calling source.select() if the value is buffered. 2017-01-22 23:35:02 +01:00
Serj Lotutovici
5904b9ce8b Class and Enum adapters now rely only on Options. 2017-01-22 23:08:52 +01:00
Jesse Wilson
db30df146f Merge pull request #217 from serj-lotutovici/sl/make_options_public
Make JsonReader.selectName and JsonReader.selectString public.
2017-01-22 16:30:13 -05:00
Serj Lotutovici
89f4527466 Make JsonReader.selectName and JsonReader.selectString public.
* Make JsonReader.Options public by extent.
* Both select methods now stip out unnecessary escaping.
* Re-order tests for select methods.
2017-01-22 22:06:45 +01:00
jwilson
94ff4b7cc2 Prepare tests for a 2nd implementation of JsonWriter. 2017-01-22 15:07:45 -05:00
Jesse Wilson
459755b98f Merge pull request #227 from serj-lotutovici/sl/know_your_factory
Make JsonReaderFactory implement toString().
2017-01-22 06:26:04 -08:00
Serj Lotutovici
c69049661b Make JsonReaderFactory implement toString(). 2017-01-22 09:36:24 +01:00
Jake Wharton
8d80e1bbae Merge pull request #226 from square/jwilson.0121.more_object_reader
Fix some bugs and increase tests for ObjectJsonReader.
2017-01-21 23:50:00 -05:00
jwilson
aa9125bb81 Fix some bugs and increase tests for ObjectJsonReader.
https://github.com/square/moshi/issues/89
2017-01-21 23:06:16 -05:00
Jesse Wilson
bc73b075f5 Merge pull request #222 from square/jwilson.0117.object_json_reader
First step of a JsonReader that reads a DOM.
2017-01-21 05:12:16 -08:00
jwilson
1be3e84733 First step of a JsonReader that reads a DOM.
https://github.com/square/moshi/issues/89
2017-01-21 05:12:03 -08:00
Jesse Wilson
8217219112 Merge pull request #225 from NightlyNexus/eric/add-null
Disallow Moshi.Builder.add(null)
2017-01-17 18:23:03 -08:00
Eric Cochran
fb3e9e8b47 Fix null 2017-01-17 18:13:44 -08:00
Eric Cochran
a16323db02 Disallow Moshi.Builder.add(null) 2017-01-17 17:51:04 -08:00
jwilson
c0a05b56bd Merge branch 'serj-lotutovici-sl/fix_long_parsing'
* serj-lotutovici-sl/fix_long_parsing:
  Fix Long parsing for big values.
2017-01-16 13:47:40 -05:00
Serj Lotutovici
38a06b080d Fix Long parsing for big values. 2017-01-16 13:47:29 -05:00