Skip to content

Update retrofit monorepo to v2.12.0 #5114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 13, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
com.squareup.retrofit2:converter-jackson 2.9.0 -> 2.12.0 age adoption passing confidence
com.squareup.retrofit2:retrofit 2.9.0 -> 2.12.0 age adoption passing confidence

Release Notes

square/retrofit (com.squareup.retrofit2:converter-jackson)

v2.12.0

Compare Source

New

  • First-party converters now support deferring serialization to happen when the request body is written (i.e., during HTTP execution) rather than when the HTTP request is created. In some cases this moves conversion from a calling thread to a background thread, such as in the case when using Call.enqueue directly.

    The following converters support this feature through a new withStreaming() factory method:

    • Gson
    • Jackson
    • Moshi
    • Protobuf
    • Wire

Fixed

  • Primitive types used with @Tag now work by storing the value boxed with the boxed class as the key.

v2.11.0

Compare Source

New

  • The built-in OptionalConverterFactory is now public to allow installing it before other converters which consume all types (e.g., Moshi, Gson, Jackson, etc.).

Fixed

  • Ensure that exceptions thrown from failure to parse method annotations can be observed by multiple threads/callers. Previously only the first caller would see the actual parsing exception and other callers would get a cryptic ClassCastException.

v2.10.0

Compare Source

New

  • Support using Unit as a response type. This can be used for non-body HTTP methods like HEAD or body-containing HTTP methods like GET where the body will be discarded without deserialization.

  • kotlinx.serialization converter!

    This was imported from github.com/JakeWharton/retrofit2-kotlinx-serialization-converter/ and remains unchanged from its 1.0.0 release.

    The Maven coordinates are com.squareup.retrofit2:converter-kotlinx-serialization.

  • JAXB 3 converter!

    The Maven coordinates are com.squareup.retrofit2:converter-jaxb3.

  • @Header, @Headers, and @HeaderMap can now set non-ASCII values through the allowUnsafeNonAsciiValues annotation property. These are not technically compliant with the HTTP specification, but are often supported or required by services.

  • Publish a BOM of all modules. The Maven coordinates are com.squareup.retrofit2:retrofit-bom.

  • Invocation now exposes the service Class<?> and the instance on which the method was invoked. This disambiguates the source when service inheritence is used.

  • A response type keeper annotation processor is now available for generating shrinker rules for all referenced types in your service interface. In some cases, it's impossible for static shrinker rules to keep the entirety of what Retrofit needs at runtime. This annotation processor generates those additional rules. For more info see its README.

Changed

  • Add shrinker rules to retain the generic signatures of built-in types (Call, Response, etc.) which are used via reflection at runtime.
  • Remove backpressure support from RxJava 2 and 3 adapters. Since we only deliver a single value and the Reactive Streams specification states that callers must request a non-zero subscription value, we never need to honor backpressure.
  • Kotlin Retrofit.create function now has a non-null lower bound. Even if you specified a nullable type before this function would never return null.
  • Suspend functions now capture and defer all Throwable subtypes (not just Exception subtypes) to avoid Java's UndeclaredThrowableException when thrown synchronously.
  • Eagerly reject suspend fun functions that return Call<Body>. These are never correct, and should declare a return type of Body directly.
  • Support for Java 14-specific and Java 16-specific reflection needed to invoke default methods on interfaces have been moved to separate versions of a class through a multi-release jar. This should have no observable impact other than the jar now contains classes which target Java 14 and Java 16 bytecode that might trip up some static analysis tools which are not aware of multi-release jars.
  • Parameter names are now displayed in exception messages when available in the underlying Java bytecode.
  • Jackson converter now supports binary formats by using byte streams rather than character streams in its implementation. Use the create(ObjectMapper, MediaType) overload to supply the value of the Content-Type header for your format.

Fixed

  • Do not include synthetic methods when doing eager validation.
  • Use per-method rather than per-class locking when parsing annotations. This eliminates contention when multiple calls are made in quick succession at the beginning of the process lifetime.

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 these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@jpelgrom
Copy link
Member

jpelgrom commented Mar 15, 2025

Requested a rebase as this would bump Jackson (#4323 (comment)) so this should be caught by CI now.

@renovate renovate bot force-pushed the renovate/retrofit-monorepo branch from 77eb9a4 to b47582a Compare March 15, 2025 10:02
Copy link

github-actions bot commented Mar 15, 2025

Test Results

 30 files   30 suites   2m 50s ⏱️
 85 tests  83 ✅ 0 💤 2 ❌
103 runs  101 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit 7a90c6f.

♻️ This comment has been updated with latest results.

@renovate renovate bot force-pushed the renovate/retrofit-monorepo branch 2 times, most recently from 4f8a592 to fbb624e Compare April 1, 2025 10:47
@renovate renovate bot force-pushed the renovate/retrofit-monorepo branch 2 times, most recently from 6c896fe to 90d826e Compare April 6, 2025 19:26
@renovate renovate bot force-pushed the renovate/retrofit-monorepo branch from 90d826e to 5bde4b2 Compare April 24, 2025 10:22
@renovate renovate bot force-pushed the renovate/retrofit-monorepo branch from 5bde4b2 to 1375a2d Compare May 6, 2025 17:08
@renovate renovate bot force-pushed the renovate/retrofit-monorepo branch from 1375a2d to 7a90c6f Compare May 18, 2025 19:04
@renovate renovate bot changed the title Update retrofit monorepo to v2.11.0 Update retrofit monorepo to v2.12.0 May 18, 2025
@TimoPtr
Copy link
Collaborator

TimoPtr commented May 19, 2025

Closed in favor to v3 #5321

@TimoPtr TimoPtr closed this May 19, 2025
Copy link
Contributor Author

renovate bot commented May 19, 2025

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (2.12.0). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/retrofit-monorepo branch May 19, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants