Commit graph

561 commits

Author SHA1 Message Date
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
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
Zac Sweers
78821bbc80 Update to KotlinPoet 1.0.0-RC1 (#599)
* Update to kotlinpoet 1.0.0-RC1

* Move to WildcardTypeName.STAR

* simpleNames() function -> simpleNames property

* packageName() fun -> packageName property

* simpleName() fun -> simpleName property

* Check if bounds are empty for TypeVariableName. If so, use no-bounds creator

* Use new parameterizedBy/plusParameter API where appropriate
2018-07-17 22:44:20 -04:00
Jesse Wilson
bcd61c9621
Merge pull request #592 from runningcode/no/readme-update
Update readme to add information about depending on stdlib.
2018-07-03 16:57:56 -04:00
Nelson Osacky
2d7d2c116d Update readme to add information about depending on stdlib. 2018-07-03 22:52:49 +02:00
Jesse Wilson
0b0883db68
Merge pull request #584 from square/eric.emptyDocumentHasNextReturnsFalse
Fix hasNext to return false at document end.
2018-06-24 10:34:46 -04:00
Jesse Wilson
de79ed364e
Merge pull request #582 from hzsweers/z/fixGeneratedAnnotation
Fix GeneratedAnnotation member definition
2018-06-24 10:03:08 -04:00
Eric Cochran
627e62f507 Fix hasNext to return false at document end. 2018-06-22 15:18:22 -07:00
Zac Sweers
c9aee2e853 Fix GeneratedAnnotation member definition
Before this was just adding both as varargs of "value"
2018-06-15 22:09:13 -07:00
Jesse Wilson
03ada87e90
Merge pull request #576 from square/eric.private-transient
Allow private transient Kotlin properties.
2018-06-07 10:26:44 -04:00
Eric Cochran
4666e06910 Allow private transient Kotlin properties. 2018-06-06 17:12:29 -07:00
Jake Wharton
cd9e600955
Merge pull request #559 from square/eric.word
Remove redundant "to" in doc.
2018-05-23 15:29:30 -04:00
Eric Cochran
df3a6ce2ae
Remove redundant "to" in doc. 2018-05-23 12:28:07 -07:00
Zac Sweers
3ecdfb6374 Fix generic typealiases (#551)
* Add generic type alias

* Fix missing resolveAliases check to fix generics

* Reword to useAbbreviatedType
2018-05-17 22:06:43 -04:00