Update dependency com.squareup.moshi:moshi to v1.15.2 #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.5.0
->1.15.2
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
square/moshi (com.squareup.moshi:moshi)
v1.15.2
Compare Source
v1.15.1
2024-01-30
3.7.0
v1.15.0
2023-05-12
1.8.21
.1.8.21-1.0.11
.0.6.0
.1.13.2
.1.9.0
in KAPT.UNUSED_PARAMETER
in generated code.v1.14.0
2022-09-06
v1.13.0
2021-12-08
New: Support for [Kotlin Symbol Processing (KSP)][ksp]. KSP is an alternative to annotation
processing code gen. It's builds faster and better supports Kotlin language features.
To use KSP in your application you must enable the KSP Gradle plugin and add a KSP dependency
on Moshi codegen.
If you're switching from annotation processing (kapt) to KSP, you should remove the kapt plugin
and the kapt Moshi dependency.
New:
@Json(ignore = true)
is a Moshi-specific way to exclude properties from JSON encodingand decoding.
New: Support Java 16 records. (Moshi still requires Java 8 only; we're shipping a [multi-release
jar][mrjar] to better support modern JVMs.)
New: Option to disable generating R8/ProGuard files. These files prevent code shrinkers from
removing files that support JSON processing. If you're not using ProGuard or R8, you can skip
this step.
Upgrade: [Kotlin 1.6.0][kotlin_1_6_0].
v1.12.0
2021-04-01
@SuppressLint
.v1.11.0
2020-10-04
New: Kotlin extension functions and properties. Use of these extensions is only possible from
Kotlin, and requires the Kotlin stdlib dependency. This release does not have any Kotlin
requirement and can be used Kotlin-free from Java.
New: Experimental Kotlin extensions. These depend on unreleased APIs and may break in a future
release of Kotlin. If you are comfortable with this, add
@ExperimentalStdlibApi
at the callsiteor add this argument to your Kotlin compiler:
"-Xopt-in=kotlin.ExperimentalStdlibApi"
.New:
JsonReader.nextSource()
. This returns an OkioBufferedSource
that streams the UTF-8bytes of a JSON value. Use this to accept JSON values without decoding them, to delegate to
another JSON processor, or for streaming access to very large embedded values.
New:
Moshi.Builder.addLast()
. Use this when installing widely-applicable adapter factories likeKotlinJsonAdapterFactory
. Adapters registered withadd()
are preferred (in the order theywere added), followed by all adapters registered with
addLast()
(also in the order they wereadded). This precedence is retained when
Moshi.newBuilder()
is used.New:
setTag()
,tag()
methods onJsonReader
andJsonWriter
. Use these as a side-channelbetween adapters and their uses. For example, a tag may be used to track use of unexpected
data in a custom adapter.
Fix: Don't crash with a
StackOverflowError
decoding backward-referencing type variables inKotlin. This caused problems for parameterized types like
MyInterface<E : Enum<E>>
.Upgrade: [Okio 1.17.5][okio_1_7_5].
Upgrade: [Kotlin 1.4.10][kotlin_1_4_10].
v1.10.0
2020-08-26
JsonReader.promoteNameToValue()
makes it easier to build customMap
adapters.Options.strings()
.PolymorphicJsonAdapterFactory.withFallbackJsonAdapter()
makes it possible to handleunrecognized types when encoding and decoding.
JsonWriter.jsonValue
APIArrayList
instead ofList
@Metadata
annotationsv1.9.3
2020-06-11
Foo::class
in the Kotlin adapter code generation.DefaultConstructorMarker
from the check forMetadata
. A shrinker may have removedMetadata
and we should still check forDefaultConstructorMarker
.v1.9.2
2019-11-17
classes enclosed in internal classes, deprecated types with
-Werror
, primitives in typeparameters, nullables in type parameters, and type aliases in type parameters.
v1.9.1
2019-10-30
a regression where classes with 33+ parameters would crash upon decoding.
parameters and classes with multiple constructors.
v1.9.0
2019-10-29
This release requires kotlin-reflect or moshi-kotlin-codegen for all Kotlin classes.
Previously Moshi wouldn't differentiate between Kotlin classes and Java classes if Kotlin was
not configured. This caused bad runtime behavior such as putting null into non-nullable fields!
If you attempt to create an adapter for a Kotlin type, Moshi will throw an
IllegalArgumentException
.Fix this with either the reflection adapter:
Or the codegen annotation processor:
The [Kotlin documentation][moshi_kotlin_docs] explains the required build configuration changes.
New: Change how Moshi's generated adapters call constructors. Previous generated code used a
combination of the constructor and
copy()
method to set properties that have default values.With this update we call the same synthetic constructor that Kotlin uses. This is less surprising
though it requires us to generate some tricky code.
New: Make
Rfc3339DateJsonAdapter
null-safe. Previously Moshi would refuse to decode null dates.Restore that behavior by explicitly forbidding nulls with
Rfc3339DateJsonAdapter().nonNull()
.New: Require Kotlin 1.3.50 or newer.
New:
JsonWriter.valueSink()
streams JSON-formatted data inline. Use this to do basic includesof raw JSON within a streamed document.
New: Support Gradle incremental processing in code gen.
New: Improve error messages. This includes better errors when field names and JSON names
disagree, and when failing on an unknown field.
New: Support default values in
PolymorphicJsonAdapterFactory
.New: Permit multiple labels for each subtype in
PolymorphicJsonAdapterFactory
. The first labelis used when writing an object to JSON.
New: Forbid automatic encoding of platform classes in
kotlinx
. As withjava.*
,android.*
,and
kotlin.*
Moshi wants you to specify how to encode platform types.New:
@JsonClass(generator=...)
makes it possible for third-party libraries to provide generatedadapters when Moshi's default adapters are insufficient.
Fix: Simplify wildcard types like
List<? extends Number>
to their base typesList<Number>
when finding type adapters. This is especially useful with Kotlin where wildcards may be added
automatically.
Fix: Use the correct name when the
@Json
annotation uses field targeting like@field:Json
.Fix: Support multiple transient properties in
KotlinJsonAdapter
.Fix: Don't explode attempting to resolve self-referential type variables like in
Comparable<T extends Comparable<T>>
.Fix: Don't infinite loop on
skipValue()
at the end an object or array. Also disallow callingskipValue()
at the end of a document.v1.8.0
2018-11-09
New: Support JSON objects that include type information in the JSON. The new
PolymorphicJsonAdapterFactory
writes a type field when encoding, and reads it when decoding.New: Fall back to the reflection-based
KotlinJsonAdapterFactory
if it is enabled and agenerated adapter is not found. This makes it possible to use reflection-based JSON adapters in
development (so you don't have to wait for code to be regenerated on every build) and generated
JSON adapters in production (so you don't need the kotlin-reflect library).
New: The
peekJson()
method onJsonReader
let you read ahead on a JSON stream withoutconsuming it. This builds on Okio's new
Buffer.peek()
API.New: The
beginFlatten()
andendFlatten()
methods onJsonWriter
suppress unwanted nestingwhen composing adapters. Previously it was necessary to flatten objects in memory before writing.
New: Upgrade to Okio 1.16.0. We don't yet require Kotlin-friendly Okio 2.1 but Moshi works fine
with that release.
implementation("com.squareup.okio:okio:1.16.0")
Fix: Don't return partially-constructed adapters when using a Moshi instance concurrently.
Fix: Eliminate warnings and errors in generated
.kt
triggered by type variance, primitivetypes, and required values.
Fix: Improve the supplied rules (
moshi.pro
) to better retain symbols used by Moshi. Werecommend R8 when shrinking code.
Fix: Remove code generation companion objects. This API was neither complete nor necessary.
v1.7.0
2018-09-24
New:
EnumJsonAdapter
makes it easy to specify a fallback value for unknown enum constants.By default Moshi throws an
JsonDataException
if it reads an unknown enum constant. With thisyou can specify a fallback value or null.
Note that this adapter is in the optional
moshi-adapters
module.implementation 'com.squareup.moshi:moshi-adapters:1.7.0'
New: Embed R8/ProGuard rules in the
.jar
file.New: Use
@CheckReturnValue
in more places. We hope this will encourage you to useskipName()
instead of
nextName()
for better performance!New: Forbid automatic encoding of platform classes in
androidx
. As withjava.*
,android.*
,and
kotlin.*
Moshi wants you to specify how to encode platform types.New: Improve error reporting when creating an adapter fails.
New: Upgrade to Okio 1.15.0. We don't yet require Kotlin-friendly Okio 2.x but Moshi works fine
with that release.
implementation 'com.squareup.okio:okio:1.15.0'
Fix: Return false from
JsonReader.hasNext()
at document's end.Fix: Improve code gen to handle several broken cases. Our generated adapters had problems with
nulls, nested parameterized types, private transient properties, generic type aliases, fields
with dollar signs in their names, and named companion objects.
v1.6.0
2018-05-14
Moshi now supports codegen for Kotlin. We've added a new annotation processor that generates
a small and fast JSON adapter for your Kotlin types. It can be used on its own or with the
existing
KotlinJsonAdapterFactory
adapter.Moshi now resolves all type parameters. Previously Moshi wouldn't resolve type parameters on
top-level classes.
New: Support up to 255 levels of nesting when reading and writing JSON. Previously Moshi would
reject JSON input that contained more than 32 levels of nesting.
New: Write encoded JSON to a stream with
JsonWriter.value(BufferedSource)
. Use this to emit aJSON value without decoding it first.
New:
JsonAdapter.nonNull()
returns a new JSON adapter that forbids explicit nulls in the JSONbody. Use this to detect and fail eagerly on unwanted nulls.
New:
JsonReader.skipName()
is likenextName()
but it avoids allocating when a name isunknown. Use this when
JsonReader.selectName()
returns -1.New: Automatic module name of
com.squareup.moshi
for use with the Java Platform Module System.This moves moshi-adapters into its own
.adapters
package and forwards the existing adapter. Itmoves the moshi-kotlin into its own
.kotlin.reflect
package and forwards the existing adapter.New: Upgrade to Okio 1.14.0.
Fix: Fail fast if there are trailing non-whitespace characters in the JSON passed to
JsonAdapter.fromJson(String)
. Previously such data was ignored!Fix: Fail fast when Kotlin types are abstract, inner, or object instances.
Fix: Fail fast if
name()
is called out of sequence.Fix: Handle asymmetric
Type.equals()
methods when doing type comparisons. Previously it waspossible that a registered type adapter would not be used because its
Type.equals()
method wasnot consistent with a user-provided type.
Fix:
JsonValueReader.selectString()
now returns -1 for non-strings instead of throwing.Fix: Permit reading numbers as strings when the
JsonReader
was created from a JSON value. Thiswas always supported when reading from a stream but broken when reading from a decoded value.
Fix: Delegate to user-adapters in the adapter for Object.class. Previously when Moshi encountered
an opaque Object it would only use the built-in adapters. With this change user-installed
adapters for types like
String
will always be honored.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.