Commit graph

18 commits

Author SHA1 Message Date
Eric Cochran
834a401122 Crash earlier for property type conflicts. (#377) 2018-02-17 22:51:02 -05:00
Jesse Wilson
5ad9d31bd8 Move modules into their own packages.
This sets the Automatic-Module-Name for moshi, moshi-adapters, and moshi-kotlin.
It moves moshi-adapters into its own .adapters package and forwards the existing
adapter. It moves the moshi-kotlin into its own .kotlin package and forwards the
existing adapter.

I'm not certain this is necessary or sufficient, but I think it's the right idea
for JPMS compatibility.
2018-02-07 04:41:06 -05:00
Eric Cochran
5b194964a9 Disallow irregular Kotlin classes. (#424) 2018-01-10 22:07:13 -05:00
Eric Cochran
d2ef4b5a61 Clarify error for non-null Kotlin properties. (#376)
Instead of throwing an InvocationTargetException.
2018-01-07 14:07:56 -05:00
Egor Andreevici
07f5d708dd Use raw string literals to improve test data readability 2017-12-15 14:01:45 +02:00
Eric Cochran
b583adac37 Clarify error message for transient parameters.
Otherwise, the error message is misleading: "No property for required constructor $parameter"
2017-11-05 01:06:54 -08:00
Eric Cochran
e0ad48cd97 Update to Kotlin 1.1.51. 2017-10-28 10:07:05 +01:00
Eric Cochran
1340ef8935 JsonAdapter.Factory.create rejects the null Type.
This fails already in Types.getRawType, but a compiler error is preferable.
2017-07-24 11:06:22 -07:00
jwilson
d3926a7f86 Add a test to demonstrate the 32-parameter limit 2017-06-10 21:07:01 -04:00
jwilson
798f14bda5 [maven-release-plugin] prepare for next development iteration 2017-05-14 22:20:00 -04:00
jwilson
f42ae45f4c [maven-release-plugin] prepare release moshi-parent-1.5.0 2017-05-14 22:19:55 -04:00
jwilson
7d5c4adc8d Use a class for KotlinJsonAdapterFactory. 2017-05-14 20:01:26 -04:00
jwilson
494992dab8 Support more kinds of properties in KotlinJsonAdapter
This makes it possible to have synthetic properties that have no
state.

Also test properties that are synthetic and have no backing field.

Closes: https://github.com/square/moshi/issues/299
2017-05-07 16:18:12 -04:00
Jesse Wilson
c65b3bf1cb Import jsr305 and use it to mark @Nullable stuff. (#297) 2017-05-06 20:31:24 -04:00
jwilson
cd1542363d KotlinJsonAdapter shouldn't convert enums.
Closes: https://github.com/square/moshi/issues/284
2017-04-21 09:54:45 -05:00
Christian Brüggemann
e76110b4b1 Fix Factory visibility (#282)
* Fix Factory visibility

* Remove redundant constructor keyword
2017-04-20 17:26:57 -05:00
jwilson
6112993919 Handle nulls symetrically in KotlinJsonAdapter.
When writing nulls we omit them, and when a value is omitted we assume
it is null.
2017-04-20 08:38:18 -05:00
Jesse Wilson
81bbe870f1 KotlinJsonAdapter (#281)
* Add kotlin-module with support for Kotlin data classes

* Naming and style changes to KotlinJsonAdapter.

Biggest changes:

 * Attempt to support regular classes and data classes
 * Avoid parameter hashing when indexing is sufficient for
   constructor parameters
2017-04-18 23:51:37 -04:00