Commit graph

568 commits

Author SHA1 Message Date
Jesse Wilson
c35e3a1550 Fix some tests that have the wrong expected exception message
The message got improved in a conflicting change to these tests being added.
2018-05-04 15:39:55 -04:00
Jesse Wilson
eb24a23568
Merge pull request #511 from square/eric.non-null
Fix error message for assigning to non-null properties.
2018-05-04 15:06:35 -04:00
Jesse Wilson
98c4358615
Merge pull request #519 from square/eric.kotlin-path
Fix path for non-null value message.
2018-05-04 14:31:39 -04:00
Jesse Wilson
bb2705128c
Merge pull request #520 from square/eric.skipName
Add JsonReader.skipName.
2018-05-04 14:14:00 -04:00
Eric Cochran
b848f1cc52 Add JsonReader.skipName. 2018-04-30 18:41:18 -07:00
Eric Cochran
dfaf3405b2 Fix path for non-null value message. 2018-04-30 18:18:34 -07:00
Eric Cochran
a0cd8a4fc0 Allow writing out raw JSON. 2018-04-29 23:49:47 -07:00
Jesse Wilson
7018cec47d
Merge pull request #516 from hzsweers/z/metadata14
Update to kotlin-metadata 1.4 and use shaded compiler
2018-04-29 20:45:20 -04:00
Zac Sweers
d195203865 Update to kotlin-metadata 1.4 and use shaded compiler
Per https://github.com/Takhion/kotlin-metadata/releases/tag/v1.4.0

Now the compiler is shaded and not prone to breaking on kotlin updates, making it more robust until Jetbrains releases an official API for reading metadata.
2018-04-28 20:30:30 -07:00
Jesse Wilson
b96397f6eb
Merge pull request #500 from square/eric.coherent-nesting-problem-error-message
Add coherent error message for uneconded map keys.
2018-04-28 21:14:45 -04:00
Jake Wharton
4f3f74f016
Merge pull request #515 from square/eric.versions
Group dependency version codes together.
2018-04-27 10:27:41 -04:00
Jake Wharton
16fd551176
Merge pull request #513 from square/eric.ep
Update Error Prone to 2.3.1.
2018-04-27 10:27:14 -04:00
Jake Wharton
fa4aa364e1
Merge pull request #512 from square/eric.moshi-docs
Fix up out-of-date comments.
2018-04-27 10:27:03 -04:00
Eric Cochran
1589ca8ddb Group dependency version codes together. 2018-04-25 16:40:20 -07:00
Eric Cochran
0d8b5efaa1
Update Error Prone to 2.3.1. 2018-04-25 16:37:46 -07:00
Eric Cochran
44e6fbd067 Add coherent error message for unencoded map keys. 2018-04-25 11:36:47 -07:00
Eric Cochran
b125f06e70
Fix up out-of-date comments. 2018-04-24 13:17:40 -07:00
Eric Cochran
51d23b5b33 Fix error message for assigning to non-null properties.
instead of falling down to "Required property 'a' missing at $"
2018-04-24 13:05:22 -07:00
Jesse Wilson
1c68437f3c
Merge pull request #506 from square/jwilson.0415.type_resolver
Begin to resolve supertype type parameters
2018-04-16 22:34:03 -04:00
Jesse Wilson
48698a61ad
Merge pull request #507 from square/eric.null-assertion
Disallow null Type from entering user code.
2018-04-16 22:32:59 -04:00
Eric Cochran
84745b0537 Disallow null Type from entering user code.
Otherwise, Moshi.adapter(null) will end up calling into user JsonAdapter factories with a null Type parameter.
Kotlin fails with java.lang.IllegalArgumentException: Parameter specified as non-null is null
That message ends up too far away from the real error.
2018-04-15 21:04:17 -07:00
Jesse Wilson
cc2c818341 Begin to resolve supertype type parameters 2018-04-15 23:21:15 -04:00
Eric Cochran
b860b6da4f
Make error message for dangling names consistent. (#501) 2018-04-15 19:48:32 -07:00
Jesse Wilson
3a2367036c
Merge pull request #505 from square/jwilson.0415.honor_kotlin_supertypes
Support generated adapters for Kotlin superclasses
2018-04-15 15:51:25 -04:00
Jesse Wilson
9401a810f0 Support generated adapters for Kotlin superclasses 2018-04-15 14:37:49 -04:00
Jesse Wilson
8d24d89abf
Model target types, parameters, constructors and properties (#504)
This is intended to make it easier to implement support for subtypes.
2018-04-15 13:46:58 -04:00
Eric Cochran
78091aeb46 Fix JsonUtf8Writer to be strict about names in the wrong place. (#502) 2018-04-15 09:39:04 -04:00
Zac Sweers
941229b6c9 Add apoptions support in KotlinCompilerCall (#499)
* Add apoptions support to KotlinCompilerCall

* Add bad annotated annotation test
2018-04-11 22:30:21 -04:00
Jesse Wilson
f9b758b5bf
Merge pull request #498 from square/jwilson.0410.multiple_types_example
Add an example that decodes multiple formats
2018-04-10 22:20:52 -04:00
Jesse Wilson
c4e4e8582d Add an example that decodes multiple formats 2018-04-10 22:08:31 -04:00
Jesse Wilson
91417d58c6
Merge pull request #496 from square/jwilson.0409.setters
Support properties that don't have a backing field.
2018-04-10 21:15:55 -04:00
Jesse Wilson
d1df4740d5 Support properties that don't have a backing field.
Currently our main loop to gather PropertyGenerators goes over the backing fields.
This needs to change to iterate over the properties themselves. That leads to a lot
of churn. The net result is slightly more compatibility with the reflective adapter.
2018-04-09 00:08:15 -04:00
Jesse Wilson
e80cf48484
Merge pull request #490 from square/jwilson.0407.generate_nonnull
Use JsonAdapter.nonNull() in generated adapters.
2018-04-08 21:05:44 -07:00
Jesse Wilson
cb9c084d30 Use JsonAdapter.nonNull() in generated adapters.
Also extract a type for the delegate key.

Also fix the generator to reject inner classes, abstract classes,
and local classes.
2018-04-08 20:54:50 -04:00
Jesse Wilson
0a49ae3ac8
Merge pull request #491 from square/eric.jsonclass-data
Remove data class limitation from JsonClass doc.
2018-04-08 05:26:37 -07:00
Jesse Wilson
ceef5dc682
Merge pull request #493 from square/eric.never-type-equals
Fix type checks with custom adapters.
2018-04-08 05:26:13 -07:00
Jesse Wilson
e43a173f46
Merge pull request #494 from square/eric.2018-04-07.with-no-annotations
Make "no adapter" error message friendlier.
2018-04-08 04:27:55 -07:00
Eric Cochran
ba1318cc45 Make "no adapter" error message friendlier.
In the very common case, there are no JsonQualifier annotations for the type.
2018-04-08 00:48:38 -07:00
Eric Cochran
fa1f10dc77
Fix type checks with custom adapters.
Moshi.Builder.add(Type, ...) adds a factory that had a broken type equality check.
Closes #128
2018-04-08 00:42:46 -07:00
Eric Cochran
c4a2e7657f
Remove data class limitation from JsonClass doc. 2018-04-07 20:33:22 -07:00
Jesse Wilson
2cc878da81
Merge pull request #489 from jemaystermind/jemaystermind/indent-json
Indent JSON string properly
2018-04-07 05:07:03 -07:00
Jeremy Tecson
bfa14a0d66
Indent JSON string properly 2018-04-07 17:59:02 +08:00
Jesse Wilson
5ecb55ad1e
Merge pull request #488 from square/eric.okio-update
Update to Okio 1.14.0.
2018-04-06 20:20:52 -07:00
Jesse Wilson
73f8774aa8
Merge pull request #487 from square/eric.adapters-readme
Use direct link to adapters snapshots.
2018-04-06 20:20:32 -07:00
Jesse Wilson
b52d63dfbf
Merge pull request #486 from square/eric.integration-reflect
Remove kotlin-reflect dep from integration-test.
2018-04-06 20:19:55 -07:00
Eric Cochran
083210eb40 Add generated code file comment. (#485) 2018-04-06 20:18:43 -07:00
Eric Cochran
14f2dcc357
Update to Okio 1.14.0. 2018-04-06 17:10:33 -07:00
Eric Cochran
e5e4fde1dc
Use direct link to adapters snapshots. 2018-04-06 16:23:51 -07:00
Eric Cochran
7d4a10f521
Remove kotlin-reflect dep from integration-test. 2018-04-06 16:17:26 -07:00
Eric Cochran
dbdf48777c Simplify example code. (#483)
* Simplify example code.

This was copied code from a different example that used the delegate annotations.

* Make brackets consistent.
2018-04-05 11:05:40 -07:00