lysine-dev/retrofit
60.7
Adequate · 13 November 2026
13.2k
lines of production code
Java
with JavaScript
8
measurements over time
What this system is
Features
Add Guava ListenableFuture adapter
Retrofit now supports Guava's ListenableFuture as a return type for service methods. By adding GuavaCallAdapterFactory to your Retrofit instance, you can return ListenableFuture\<T\> to receive the deserialized body (with HttpException for non-2XX responses) or ListenableFuture\<Response\<T\>\> to receive the full Response object. The adapter also includes a deprecated, local HttpException wrapper for compatibility.
retrofit-adapters/guava/src/main · high confidence
Add JAXB 3 XML converter
A new \converter-jaxb3\ module is added, providing a Retrofit converter that uses JAXB 3.x (\jakarta.xml.bind\) to serialize and deserialize XML. Users can add this dependency to enable automatic XML handling for request bodies and response bodies, with support for a default or user-supplied \JAXBContext\. Note that this converter does not work on Android.
retrofit-converters/jaxb3 · high confidence
Add RxJava 3 adapter
Retrofit now includes a new adapter module for RxJava 3, enabling users to return \Observable\ types from their service interfaces. This addition introduces new classes to handle both synchronous and asynchronous execution of HTTP calls within the RxJava 3 reactive streams model, along with the necessary ProGuard rules to preserve generic signatures for result types.
retrofit-adapters/rxjava3/src/main · high confidence
Add Scala Future adapter
Users can now use Scala \Future\ as a return type for Retrofit service methods by adding \ScalaCallAdapterFactory\ to their Retrofit builder. This adapter supports both body-only returns (e.g., \Future\<User\>\) and response-wrapped returns (e.g., \Future\<Response\<User\>\>\), allowing Scala applications to integrate seamlessly with Retrofit's asynchronous execution model.
retrofit-adapters/scala · high confidence
Add Scalars converter for primitive and String types
The Scalars converter factory is now available to automatically convert String, boolean, byte, char, double, float, int, long, and short types (both primitives and their boxed wrappers) to and from text/plain HTTP bodies. Users can add this converter to their Retrofit instance to handle scalar request and response bodies without manual parsing.
retrofit-converters/scalars/src/main · high confidence
Add kotlinx.serialization converter
This change introduces a new converter module that integrates Retrofit with the kotlinx.serialization library. Users can now use \Json.asConverterFactory()\ for string-based payloads (like JSON) or \ProtoBuf.asConverterFactory()\ for binary formats (like Protocol Buffers) to automatically serialize request bodies and deserialize response bodies. The implementation supports standard serializable types as well as contextual serializers via \SerializersModule\, allowing for flexible type handling within Retrofit services.
retrofit-converters/kotlinx-serialization · high confidence
Add support for Guava Optional in response conversion
Users can now use Guava's Optional type as a return type for Retrofit service methods. A new GuavaOptionalConverterFactory has been added to handle deserialization by delegating to an inner converter for the wrapped type and wrapping the result in Optional. Proguard rules have also been added to preserve the generic signature of Optional for R8 full mode.
retrofit-converters/guava/src/main · high confidence
Add support for the HTTP QUERY method
Retrofit now supports the QUERY HTTP method via a new @QUERY annotation, allowing service interface methods to send requests using the QUERY verb. This enables developers to interact with servers that expose QUERY endpoints, extending Retrofit's existing support for standard HTTP methods like GET, POST, PUT, and DELETE.
retrofit/src · high confidence
Added 1.x API documentation for the Jackson converter
The website now serves the generated Javadoc for the \retrofit.converter\ package in the 1.x branch, specifically documenting the \JacksonConverter\ class which uses Jackson for reading and writing entities. This includes the full set of static HTML pages (index, class details, hierarchy, and help) for the Converter: Jackson 1.9.0 API.
website/public · high confidence
Initial JAXB converter for XML serialization
Adds a new \converter-jaxb\ module that enables Retrofit to serialize and deserialize Java objects to and from XML using the JAXB library. Users can now add the \converter-jaxb\ dependency and register the \JaxbConverterFactory\ to handle XML payloads. The implementation supports custom \JAXBContext\ configuration, handles character encoding correctly, and includes security hardening by disabling the loading of remote entities and external DTDs to prevent XXE attacks. Note that this converter is not compatible with Android.
retrofit-converters/jaxb · high confidence
Introduce Moshi JSON converter for Retrofit
Adds a new MoshiConverterFactory that enables Retrofit to serialize and deserialize JSON using the Moshi library. Users can now configure the converter to handle null values, enforce strict unknown-field handling, enable lenient parsing, and stream request bodies for improved memory efficiency. The converter also automatically skips UTF-8 BOMs in responses and ensures full document consumption.
retrofit-converters/moshi/src/main · high confidence
Introduce RxJava 2 adapter for Retrofit
This change adds the \retrofit2:adapter-rxjava2\ module, enabling Retrofit service methods to return RxJava 2 types such as \Observable\, \Flowable\, \Single\, \Maybe\, and \Completable\. The new \RxJava2CallAdapterFactory\ supports synchronous and asynchronous execution modes, allowing users to integrate RxJava 2 reactive streams directly into their network calls.
retrofit-adapters/rxjava2/src/main/java · high confidence
Introduce Wire converter with streaming support
The Wire converter is now available in the \retrofit2.converter.wire\ package, allowing Retrofit to serialize and deserialize Protocol Buffers using Square's Wire library. Users can enable streaming for request bodies by calling \withStreaming()\ on the factory, which sends data directly to the HTTP thread rather than buffering it in memory, while response bodies are always decoded on OkHttp's background threads.
retrofit-converters/wire/src/main/java · high confidence
New behavior-driven mock API with NetworkBehavior and coroutine support
The retrofit-mock module introduces a new \BehaviorDelegate\ pattern that applies configurable network characteristics—such as delay, variance, failure rates, and HTTP error simulation—to mock Retrofit service interfaces. Users can now create mock services via \MockRetrofit.Builder\ that simulate realistic network conditions using \NetworkBehavior\, including the ability to trigger specific HTTP error responses. This new API also adds first-class support for Kotlin \suspend\ functions, allowing mock calls to be used directly in coroutines via \BehaviorDelegate\.
retrofit-mock/src/main · high confidence
New samples demonstrating advanced Retrofit patterns
The samples directory now includes examples for using custom converter factories to select serialization formats via annotations (AnnotatedConverters, JsonAndXmlConverters), handling chunked request bodies (ChunkingConverter), and deserializing error response bodies (DeserializeErrorBody). It also provides samples for custom call adapters with granular error handling (ErrorHandlingAdapter), tracking invocation metrics via interceptors (InvocationMetrics), using RxJava with custom schedulers (RxJavaObserveOnMainThread), and creating mock service implementations (SimpleMockService). Additional samples cover dynamic base URLs via interceptors (DynamicBaseUrl), web crawling (Crawler), and conditional logging (ConditionalLoggingInterceptor).
samples · high confidence
Streaming support for Gson request bodies
The Gson converter now supports streaming request bodies via the new GsonStreamingRequestBody class, which writes JSON directly to the output sink using the Gson TypeAdapter. This allows large objects to be serialized without loading the entire JSON representation into memory, improving efficiency for high-volume or large-payload requests.
(repo-wide) · high confidence
Behavioural changes
Added ProGuard keep rules for Protobuf parsers
The Protobuf converter now includes a ProGuard configuration file that preserves the static \parser()\ method and the \PARSER\ field on classes implementing \com.google.protobuf.MessageLite\. This ensures that reflective lookups for these parser instances succeed during runtime, preventing crashes or missing functionality when the application is obfuscated or optimized.
retrofit-converters/protobuf/src/main/resources · high confidence
Added ProGuard keep rules for RxJava Result types
The RxJava 1.x and RxJava 2.x adapters now include explicit ProGuard configuration files that preserve the generic signatures of the \Result\ class. This ensures that when using R8 full mode, the adapter correctly handles \Result\ types used as nested return types (such as \Observable\<Result\<String\>\>\), preventing signature stripping that could break functionality.
retrofit-adapters/rxjava/src/main/resources, retrofit-adapters/rxjava2/src/main/resources · high confidence
Added ProGuard keep rules for Wire converter
The Wire converter now includes a ProGuard configuration file that preserves the static \ADAPTER\ field on classes extending \com.squareup.wire.Message\. This ensures that the reflective lookup of the adapter required for serialization and deserialization continues to function correctly when code is obfuscated or stripped.
retrofit-converters/wire/src/main/resources · high confidence
Deprecation of Java 8 CompletableFuture adapter
The Java 8 adapter module, including the \Java8CallAdapterFactory\ and its associated \HttpException\ wrapper, has been deprecated. Users returning \CompletableFuture\ from service methods no longer need to explicitly add this factory to their Retrofit instance, as support for Java 8 futures is now included in the Retrofit core. The adapter remains available but is marked for removal in future versions.
retrofit-adapters/java8/src/main · high confidence
Gson converter refactored with streaming support and strict JSON consumption
The Gson converter implementation has been restructured into its own package (retrofit2.converter.gson) and now supports streaming serialization for request bodies via the new \withStreaming()\ method on \GsonConverterFactory\, which writes JSON directly to the HTTP output stream instead of buffering it in memory. Additionally, response body conversion now strictly asserts that the entire JSON document is consumed, throwing a \JsonIOException\ if trailing content remains, and the factory now passes method annotations to the request body converter factory for better annotation handling.
retrofit-converters/gson/src/main · high confidence
Jackson converter refactored with streaming support
The Jackson converter implementation has been restructured into its own package (retrofit2.converter.jackson) and now supports streaming serialization for request bodies. Users can enable this mode via the new withStreaming() method on JacksonConverterFactory, which writes request data directly to the HTTP stream instead of buffering it in memory. The factory also now passes method annotations to the requestBodyConverter, and the codebase has been updated with JSR 305 nullability annotations and reformed using google-java-format.
retrofit-converters/jackson/src/main · high confidence
Java 8 Optional converter factory deprecated
The \Java8OptionalConverterFactory\ in the \retrofit-converters/java8\ module is now deprecated, as support for \Optional\ types has been moved into the Retrofit core. Users no longer need to explicitly add this converter to their Retrofit instance; the core library handles \Optional\<T\>\ deserialization automatically. The converter class remains present but marked with \@Deprecated\ to guide users toward the built-in functionality.
retrofit-converters/java8/src/main · high confidence
New website documentation site
The documentation site has been rebuilt using Astro and Starlight. This update introduces a new content configuration that displays a snapshot banner for non-release builds, implements a green-themed CSS design with dark and light mode support, and migrates the documentation content to Markdown/MDX files.
website/src · high confidence
Retrofit Protobuf converter now supports streaming and extension registries
The Protobuf converter in the \retrofit2.converter.protobuf\ package has been refactored to support streaming serialization of request bodies and the use of a Protobuf extension registry during deserialization. Users can now enable streaming via the new \withStreaming()\ method on \ProtoConverterFactory\, which sends request data directly to the HTTP thread without buffering the entire message in memory. Additionally, the \createWithRegistry()\ factory method allows users to supply an \ExtensionRegistryLite\ for handling custom Protobuf extensions when parsing responses. The converter also now supports both the modern \parser()\ method and the legacy \PARSER\ field for compatibility with older Protobuf versions.
retrofit-converters/protobuf/src/main/java · high confidence
Rewritten RxJava adapter with improved error handling and new Result type
The RxJava adapter has been completely rewritten to provide more robust error handling and new capabilities. It now introduces a \Result\<T\>\ wrapper type, allowing users to observe both successful responses and errors as data items rather than having errors sent to the error channel. The adapter also supports \Single\ and \Completable\ return types in addition to \Observable\. Internally, the implementation uses a new \CallArbiter\ to better manage the lifecycle of HTTP calls and subscriptions, ensuring that errors are propagated correctly even in complex scenarios, and fixes issues where downstream disposal was incorrectly conflated with upstream cancellation.
retrofit-adapters/rxjava/src/main/java · high confidence
SimpleXML converter is deprecated in favor of JAXB
The SimpleXML converter factory and its associated request/response converters have been deprecated, signaling that users should migrate to the JAXB converter. The implementation remains available but is marked as deprecated in the API.
retrofit-converters/simplexml/src/main · high confidence
Updated ProGuard keep rules to allow shrinking
The annotation processor now generates ProGuard rules that include the \allowshrinking\ flag alongside \allowoptimization\ and \allowobfuscation\. This change means that classes identified by the processor are no longer strictly preserved from shrinking, allowing the build tool to remove unused code more aggressively while still protecting them from obfuscation and optimization issues.
retrofit-response-type-keeper · high confidence
Website rebuilt with Astro and Starlight with versioned documentation support
The documentation site has been migrated to use the Astro framework with the Starlight theme, replacing the previous implementation. This change introduces mode-specific environment configurations (\.env.release\ and \.env.snapshot\) to manage the site URL and base path, allowing the build process to distinguish between production releases and snapshot builds. The new configuration includes a sidebar that organizes resources by version, providing direct links to Javadoc for 1.x, 2.x, and 3.x, and integrates a link validator plugin to maintain documentation integrity.
website · high confidence
Test coverage
Added Android integration tests for CompletableFuture, Optional, and Uri support; Added Android integration tests for basic calls and default methods; Added Java test suite for core Retrofit components; Added Kotlin-specific test coverage for suspend functions and extensions; Added comprehensive test coverage for RxJava 2 adapter; Added comprehensive test suite for core Retrofit components; Added phone.proto test schema for Protobuf converter; Added test coverage for the RxJava 3 adapter; Added tests for Gson converter factory and streaming support; Added tests for Guava and Java 8 Optional converter factories; Added tests for Jackson converter streaming and CBOR support; Added tests for Kotlin Unit and raw Response types; Added tests for Moshi converter factory configuration and behavior; Added tests for Protobuf converter fallback and extension registry support; Added tests for Wire converter serialization and streaming behavior; Added tests for the Guava ListenableFuture adapter; Added tests for the Java 8 CompletableFuture adapter; Added tests for the Scalars converter factory; Added tests for the Scalars converter factory; Added tests for the new mock behavior delegate and call utilities; Expanded test coverage for RxJava adapter error handling and lifecycle.
Dependencies
Migrate build system to Gradle with version catalogs
The project has converted its build configuration from Maven/Gradle hybrid or legacy formats to a modern Gradle multi-project structure. This change introduces a central \gradle/libs.versions.toml\ file to manage all dependency versions (including Kotlin 2.4.10, OkHttp 5.5.0, and Android Gradle Plugin 9.3.2) and uses type-safe project accessors for subproject references. The build now enforces Java 8 toolchains, integrates Error Prone for static analysis, applies Spotless for code formatting, and configures Animal Sniffer for API compatibility checks. Subprojects for adapters (Guava, Java 8, RxJava, Scala) and converters (Gson, Jackson, JAXB, Moshi, Protobuf, etc.) are now defined as individual Gradle modules with explicit dependency declarations.
(dependencies) · high confidence
Upgrade Gradle wrapper to version 9.7.1
The project's Gradle wrapper has been updated to use Gradle 9.7.1. This ensures that builds are executed with a consistent, specific version of the Gradle build tool, eliminating potential discrepancies caused by different local Gradle installations and leveraging the features and stability of the latest release.
gradle · high confidence
Housekeeping
Initial project scaffolding and documentation
The repository has been initialized with essential configuration and documentation files, including an .editorconfig for consistent code formatting, .gitattributes and .gitignore for version control hygiene, and a BUG-BOUNTY.md file directing security researchers to report vulnerabilities via Bugcrowd. Standard project files such as the Apache 2.0 LICENSE, a detailed CHANGELOG.md, CONTRIBUTING.md guidelines, and RELEASING.md procedures have been added, alongside the Gradle wrapper scripts (gradlew, gradlew.bat) to enable consistent builds. The old README file was replaced with a new one specifying Java 8/Android 21+ requirements and Maven coordinates for version 3.0.0.
(repo-wide) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 62 → 61 (-1.3)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.
Lenses
- Code Health 71 → 69 (-2.2)
- Architecture 90 → 90 (-0.6)
- Maturity 56 → 56 (+0.0)
- Readiness 56 → 57 (+1.4)
- Security 75 → 63 (-12.5)
- Performance 100 → 100 (+0.0)
Resolved (132)
- Documentation: no project overview (retrofit-converters/kotlinx-serialization/README.md)
- No assertions: bodyFailure (retrofit-adapters/rxjava/src/test/java/retrofit2/adapter/rxjava/ObservableTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava/src/test/java/retrofit2/adapter/rxjava/SingleTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava2/src/test/java/retrofit2/adapter/rxjava2/FlowableTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava2/src/test/java/retrofit2/adapter/rxjava2/MaybeTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava2/src/test/java/retrofit2/adapter/rxjava2/ObservableTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava2/src/test/java/retrofit2/adapter/rxjava2/SingleTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava3/src/test/java/retrofit2/adapter/rxjava3/FlowableTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava3/src/test/java/retrofit2/adapter/rxjava3/MaybeTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava3/src/test/java/retrofit2/adapter/rxjava3/ObservableTest.java)
- No assertions: bodyFailure (retrofit-adapters/rxjava3/src/test/java/retrofit2/adapter/rxjava3/SingleTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava/src/test/java/retrofit2/adapter/rxjava/ObservableTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava/src/test/java/retrofit2/adapter/rxjava/SingleTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava2/src/test/java/retrofit2/adapter/rxjava2/FlowableTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava2/src/test/java/retrofit2/adapter/rxjava2/MaybeTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava2/src/test/java/retrofit2/adapter/rxjava2/ObservableTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava2/src/test/java/retrofit2/adapter/rxjava2/SingleTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava3/src/test/java/retrofit2/adapter/rxjava3/FlowableTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava3/src/test/java/retrofit2/adapter/rxjava3/MaybeTest.java)
- No assertions: bodySuccess200 (retrofit-adapters/rxjava3/src/test/java/retrofit2/adapter/rxjava3/ObservableTest.java)
- …and 112 more
New (21)
- Edited copies of one member (3 members, 17+ corresponding lines) (retrofit-adapters/rxjava/src/main/java/retrofit2/adapter/rxjava/BodyOnSubscribe.java)
- Edited copies of one member (3 members, 27+ corresponding lines) (retrofit/src/main/java/retrofit2/Retrofit.java)
- Edited copies of one member (3 members, 50+ corresponding lines) (retrofit-adapters/rxjava/src/main/java/retrofit2/adapter/rxjava/RxJavaCallAdapterFactory.java)
- Edited copy of a member (11 corresponding lines) (retrofit/src/main/java/retrofit2/ParameterHandler.java)
- Edited copy of a member (12 corresponding lines) (retrofit-converters/wire/src/main/java/retrofit2/converter/wire/WireConverterFactory.java)
- Edited copy of a member (12 corresponding lines) (retrofit/src/main/java/retrofit2/Response.java)
- Edited copy of a member (13 corresponding lines) (retrofit-converters/moshi/src/main/java/retrofit2/converter/moshi/MoshiConverterFactory.java)
- Edited copy of a member (16 corresponding lines) (retrofit/src/main/java/retrofit2/KotlinExtensions.kt)
- Edited copy of a member (18 corresponding lines) (retrofit-adapters/guava/src/main/java/retrofit2/adapter/guava/GuavaCallAdapterFactory.java)
- Edited copy of a member (18 corresponding lines) (retrofit-adapters/scala/src/main/java/retrofit2/adapter/scala/BodyCallAdapter.java)
- Edited copy of a member (22 corresponding lines) (samples/src/main/java/com/example/retrofit/DeserializeErrorBody.java)
- Edited copy of a member (23 corresponding lines) (samples/src/main/java/com/example/retrofit/ChunkingConverter.java)
- Edited copy of a member (27 corresponding lines) (retrofit-adapters/java8/src/main/java/retrofit2/adapter/java8/Java8CallAdapterFactory.java)
- Edited copy of a member (27 corresponding lines) (retrofit-adapters/rxjava/src/main/java/retrofit2/adapter/rxjava/CallArbiter.java)
- Edited copy of a member (7 corresponding lines) (retrofit-adapters/java8/src/main/java/retrofit2/adapter/java8/Java8CallAdapterFactory.java)
- Off-boarding risk: anonymized user #1
- Outdated (compile): com.fasterxml.jackson.core:jackson-annotations
- Outdated (compile): com.squareup.wire:wire-runtime
- Outdated (compile): com.squareup.wire:wire-runtime-jvm
- Outdated (compile): org.commonmark:commonmark
- …and 1 more
Changes since last survey
- 18 commits — 18 feature/other, 0 fixes
By area
- gradle/libs.versions.toml — 14 commits
- .github/workflows — 2 commits
- gradle/wrapper — 1 commit
- retrofit-adapters/rxjava2 — 1 commit
Notable commits
- change: Update Gradle to v9.8.2 (#4797)
- change: Update actions/setup-java action to v6.2.0 (#4814)
- change: Update dependency com.android.tools.build:gradle to v9.5.0 (#4805)
- change: Update dependency com.android.tools.build:gradle to v9.5.1 (#4819)
- change: Update dependency com.diffplug.spotless:spotless-plugin-gradle to v8.11.0 (#4810)
- change: Update dependency com.google.code.gson:gson to v2.15.0 (#4801)
- change: Update dependency com.google.errorprone:error_prone_core to v2.51.0 (#4800)
- change: Update dependency com.google.errorprone:error_prone_core to v2.52.0 (#4811)
- change: Update dependency com.google.googlejavaformat:google-java-format to v2 (#4807)
- change: Update dependency com.google.protobuf:protobuf-gradle-plugin to v0.10.1 (#4813)
- change: Update dependency com.google.testparameterinjector:test-parameter-injector to v1.25 (#4799)
- change: Update dependency com.squareup.wire:wire-runtime to v7.1.2 (#4803)
- change: Update dependency net.ltgt.gradle:gradle-errorprone-plugin to v5.2.0 (#4806)
- change: Update dependency org.jetbrains.dokka:dokka-gradle-plugin to v2.3.0 (#4820)
- change: Update dependency org.jsoup:jsoup to v1.24.1 (#4812)
- change: Update gradle/actions action to v6.4.1 (#4804)
- change: Update jackson monorepo to v2.22.4 (#4795)
- change: Update kotlinx.serialization to v1.12.0 (#4798)
Architecture
- Unchanged — 0 containers · 11 contexts · 11 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
lysine-dev/retrofit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit ce1449cf392a989b66bf7349272a2a1dde6024d6 — the exact code this score is about.
- Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-f3449e6eb431.