Commit graph

573 commits

Author SHA1 Message Date
Jesse Wilson
83b6b26e63
Merge pull request #659 from square/eric.exception-cause
Add exception cause for method adapter creation.
2018-09-12 22:24:22 -04:00
Jesse Wilson
62c14b872d
Merge pull request #658 from square/eric.okio15
Update to Okio 1.15.0.
2018-09-12 22:23:56 -04:00
Zac Sweers
d6ad1b8bad
Merge pull request #667 from oldergod/bquenaudon/2018-09-12/androidx
Don't reflect on androidX
2018-09-12 15:08:01 -07:00
Benoit Quenaudon
c606f43a3d
Don't reflect on androidX 2018-09-12 15:11:42 -04:00
Eric Cochran
46a42bc7ed Add exception cause for method adapter creation. 2018-09-11 22:25:09 -07:00
Eric Cochran
3fa09dd110 Update to Okio 1.15.0. 2018-09-11 22:24:38 -07:00
Jesse Wilson
9050e42038
Merge pull request #656 from square/jwilson.0910.nicer_exceptions
Generate nicer stacktraces when creating a generated adapter fails.
2018-09-11 22:08:18 -04:00
Jesse Wilson
76cd590ca3 Generate nicer stacktraces when creating a generated adapter fails.
Otherwise we end up with many InvocationTargetExceptions layered in, which makes
it difficult to identify what actually failed.
2018-09-11 22:02:54 -04:00
Jesse Wilson
5bd9632756
Merge pull request #663 from square/jwilson.0911.fix_nonkotlin_test_
Don't do Kotlin reflection on a non-Kotlin class.
2018-09-11 22:02:27 -04:00
Jesse Wilson
c04f1bafde Don't do Kotlin reflection on a non-Kotlin class.
Closes: https://github.com/square/moshi/issues/662
2018-09-11 21:50:02 -04:00
Jesse Wilson
9f2ed487b2
Merge pull request #653 from square/eric.copyrightheader
Add copyright header to EnumJsonAdapterTest.
2018-09-10 20:26:18 -04:00
Jesse Wilson
484fdfe4b6
Merge pull request #655 from square/eric.2018-08-17.nullSafe-generated-adapters
Make generated adapters null-safe.
2018-09-10 19:44:26 -04:00
Eric Cochran
e7c745aac8 Make generated adapters null-safe.
This is in alignment with the lookup for Java and Kotlin reflective adapters.
2018-09-10 16:31:24 -07:00
Eric Cochran
67d07eb450
Add copyright header to EnumJsonAdapterTest. 2018-09-10 15:33:39 -07:00
Jesse Wilson
d1c2cf9c6c
Merge pull request #649 from square/jwilson.0909.uppercase_property
Test support for uppercase property names
2018-09-09 23:32:10 -04:00
Jesse Wilson
c008e0e2b6 Test support for uppercase property names
I couldn't reproduce the reported issue.

Closes: https://github.com/square/moshi/issues/574
2018-09-09 23:25:56 -04:00
Jesse Wilson
29d08353ec
Merge pull request #650 from square/jwilson.0909.private_transient
Test that @Transient private properties are ignored
2018-09-09 23:24:53 -04:00
Jesse Wilson
1ba07d4b7d Test that @Transient private properties are ignored
Closes: https://github.com/square/moshi/issues/643
2018-09-09 23:17:50 -04:00
Jesse Wilson
cb86194f8f
Merge pull request #651 from square/jwilson.0909.enclosed_parameterized
Call Types.newParameterizedTypeWithOwner when necessary.
2018-09-09 23:16:38 -04:00
Jesse Wilson
f980521c8e
Merge pull request #652 from square/jwilson.0909.include_labels
Include labels when encoding with RuntimeJsonAdapterFactory.
2018-09-09 23:12:44 -04:00
Jesse Wilson
e7cae30bd8
Merge pull request #648 from square/jwilson.0909.delegate_key
Change DelegateKey to use AnnotationSpec instead of AnnotationMirror
2018-09-09 23:12:26 -04:00
Jesse Wilson
29bb93bc29 Include labels when encoding with RuntimeJsonAdapterFactory.
Otherwise the adapter is not symmetric.
2018-09-09 17:43:42 -04:00
Jesse Wilson
306664fb6a Call Types.newParameterizedTypeWithOwner when necessary.
Otherwise we crash with an exception attempting to create an adapter
for an enclosed type that has a type parameter.

I ran into this looking for a test case for issue 615.
https://github.com/square/moshi/issues/615
2018-09-09 17:05:33 -04:00
Jesse Wilson
7382145318 Change DelegateKey to use AnnotationSpec instead of AnnotationMirror
AnnotationSpec implements equals() in the way we need, but
AnnotationMirror doesn't. As a consequence this fixes a problem
where we were generating redundant adapters.

Closes: https://github.com/square/moshi/issues/563
2018-09-09 15:27:21 -04:00
Jesse Wilson
4f3c418202
Merge pull request #647 from square/jwilson.0909.confirm_one_way_code_gen
Confirm you can use codegen with adapter methods
2018-09-09 14:00:04 -04:00
Jesse Wilson
f5fe86dd78 Confirm you can use codegen with adapter methods
We had a bug report that said using just @ToJson wasn't working.
This test attempts to show it should work just fine.

https://github.com/square/moshi/issues/545
2018-09-09 12:16:18 -04:00
Jesse Wilson
2a593da06c
Merge pull request #628 from gabrielittner/master
Embed ProGuard rules in the jar
2018-09-08 14:58:44 -04:00
Gabriel Ittner
24e0777ebd
add period to comments 2018-09-07 08:04:56 +02:00
Jesse Wilson
3c470575f4
Merge pull request #640 from square/eric.null-enum
Allow null fallback enum value in EnumJsonAdapter.
2018-09-03 09:47:16 -04:00
Eric Cochran
8a8cde0ce3 Allow null fallback enum value in EnumJsonAdapter. 2018-08-31 00:51:34 -07:00
Gabriel Ittner
597da2d861
keep BuiltInsLoaderImpl for kotlin reflect artifact 2018-08-24 10:47:22 +02:00
Jesse Wilson
f9c53f39f4
Merge pull request #629 from stoyicker/patch-1
Remove unnecessary isAccessible check
2018-08-19 16:21:39 -04:00
Jorge Antonio Díaz-Benito Soriano
56e67088a9
Remove unnecessary isAccessible check
https://github.com/square/moshi/issues/624
2018-08-19 20:46:43 +02:00
Jesse Wilson
354db6b46f
Merge pull request #627 from square/eric.2018-08-17.boxed-primitive-adapters
Make nullable primitives in codegen use boxed type adapters.
2018-08-19 07:36:12 -04:00
Jesse Wilson
0c773a38f4
Merge pull request #623 from square/jwilson.0814.dokka
Generate Kotlin documentation with Dokka
2018-08-19 07:30:52 -04:00
Gabriel Ittner
4bbc5b2ff8
Embed ProGuard rules in the jar 2018-08-19 11:14:47 +02:00
Eric Cochran
1b17423343 Make nullable primitives in codegen use boxed type adapters. 2018-08-17 13:41:43 -07:00
Eric Cochran
83f60d6bd7 Fix README link to jar. (#622) 2018-08-14 22:54:30 -04:00
Jesse Wilson
9ea1f845a8 Generate Kotlin documentation with Dokka 2018-08-14 20:20:15 -04:00
Eric Cochran
29bdc0aa45
Add EnumJsonAdapter to adapters module. (#607) 2018-08-07 15:05:56 -07:00
Eric Cochran
137ffc992f
Fix incorrect path in enum adapter error message. (#613) 2018-08-06 22:46:41 -07:00
Jesse Wilson
34f8f9472f
Merge pull request #612 from square/jwilson.0805.extension_property
Test to confirm that extension properties are not encoded or decoded
2018-08-06 04:36:34 -04:00
Eric Cochran
0f1fa3d385 Add RuntimeJsonAdapterFactory to adapters module. (#606)
* Add RuntimeJsonAdapterFactory to adapters module.

* Make RuntimeJsonAdapterFactory create null-safe adapters.

* Add copyright headers.
2018-08-06 04:35:53 -04:00
Jesse Wilson
9251309c3f
Merge pull request #603 from square/eric.patch-1
Simplify Options initializer generation.
2018-08-05 22:36:29 -04:00
Jesse Wilson
01f600cdd3
Merge pull request #604 from square/eric.💲
Fix dollar sign escaping for json key names.
2018-08-05 22:34:21 -04:00
Jesse Wilson
c360a1c840 Test to confirm that extension properties are not encoded or decoded 2018-08-05 22:20:25 -04:00
Jesse Wilson
3aa31d9135
Merge pull request #608 from square/eric.checkstyle
Remove unused import.
2018-08-05 21:26:52 -04:00
Eric Cochran
ee873b64f6
Remove unused import. 2018-07-26 17:28:15 -07:00
Eric Cochran
248be5805b Fix dollar sign escaping for json key names. 2018-07-24 18:03:23 -07:00
Eric Cochran
6bb83abf84
Simplify Options initializer generation. 2018-07-24 17:51:18 -07:00