skydoves

skydoves/sandwich

Kotlin Apache-2.0 Mobile

🥪 Sandwich is an adaptable and lightweight sealed API library designed for handling API responses and exceptions in Kotlin for Retrofit, Ktor, and Kotlin Multiplatform.

1.8k stars
113 forks
active
GitHub +2 / week

1.8k

Stars

113

Forks

5

Open issues

14

Contributors

2.3.0 29 Jun 2026

AI Analysis

Sandwich is a sealed API library for Kotlin that standardizes handling of HTTP responses and exceptions across Retrofit, Ktor, and multiplatform projects, eliminating the need for custom Result/Resource wrapper classes. It is purpose-built for backend and mobile developers using these specific networking frameworks who need a functional, operator-based approach to API response handling. General-purpose applications not using Retrofit or Ktor will derive less value.

Mobile Library Discovery value: 5/10
Documentation 8/10
Activity 9/10
Community 8/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

kotlin retrofit api-response error-handling multiplatform
Actively maintained Well documented Niche/specialized use case Production ready
Deep Analysis · Based on README and public signals
1w ago

Kotlin API response wrapper reducing boilerplate for Retrofit, Ktor, and multiplatform projects

Sandwich is a sealed-type API response library for Kotlin that abstracts HTTP response handling into functional operators, eliminating custom Resource/Result wrappers. Built primarily for Android/Retrofit but extended to Ktor and Kotlin Multiplatform, it claims 1.2M+ downloads. Targets developers seeking standardized, composable response pipelines with global error handling. Adoption appears concentrated in Android ecosystem; real-world production usage is indicated but not exhaustively documented.

Origin

Created May 2020 by skydoves (Jaesung Lee), coinciding with functional-reactive Kotlin adoption trends. Evolved from 1.x (single ApiResponse type) to 2.3.x (multiplatform support, Ktor/Ktorfit integration, test utilities). Maintains steady incremental releases; not a response to a major gap but rather a design preference alternative to Result/Resource patterns.

Growth

Star count (1,758) and fork count (113) suggest niche adoption rather than viral growth. Download count (1.2M+) indicates material real-world usage but plateau visible in recent weeks (0 stars in last 7 days). Growth appears driven by: skydoves author credibility, Google DevLibrary inclusion, Medium/YouTube documentation, and gradual multiplatform expansion. Pattern consistent with specialized library rather than category leader.

In production

README lists 6 use cases (Pokedex, ChatGPT Android, DisneyMotions, MarvelHeroes, Neko, TheMovies2), all public GitHub repos, suggesting real adoption. Download figure (1.2M+) is significant but not independently verifiable. Google DevLibrary listing provides institutional credibility. Medium article and YouTube coverage indicate developer education investment. However, market concentration among skydoves' own projects and no Fortune 500 / FAANG corporate endorsements documented.

Code analysis
Architecture

Based on README: sealed ApiResponse type with functional operators (map, fold, recover, etc.) for response transformation. Likely uses Kotlin extensions and coroutine support. Supports global middleware-style operators and custom mappers. Test library provided but implementation details not visible from README alone.

Tests

Not documented in README. Dedicated sandwich-test artifact mentioned but internal coverage unknown. Build badge present, suggesting CI/CD enforcement, but granularity unclear.

Maintenance

Last push 2026-06-29 (within 24 hours of evaluation date) indicates active maintenance. Build workflow badge suggests regular CI runs. License (Apache 2.0) and Maven Central distribution (current version 2.3.0) indicate professional stewardship. Release cadence appears measured but consistent; no signs of abandonment or crisis.

Honest verdict

ADOPT IF: you are building Kotlin/Android projects using Retrofit or Ktor and prefer composable, standardized error handling over custom wrappers, and your team values sealed types and functional operators. AVOID IF: you need a universal, language-agnostic result type, or you are uncomfortable adding a dependency for a problem you can solve with 50 lines of code, or your codebase is predominantly non-Kotlin. MONITOR IF: you are on Kotlin Multiplatform; Sandwich's KMP support is recent (evident from 2.3.x updates) and should be field-tested in your specific use case before production adoption.

Independent dimensions

Mainstream potential

4/10

Technical importance

6/10

Adoption evidence

7/10

Risks
  • Author-dependent stewardship: core maintenance by skydoves; limited evidence of large community maintenance team or corporate backing; succession risk if author moves on.
  • Multiplatform support maturity: Ktor and Ktorfit integrations added recently; edge cases and performance characteristics under KMP conditions not yet widely validated in production.
  • Sealed type design locks consumers into library abstractions; migration cost if you later want to drop Sandwich or if library diverges from project needs.
  • Download claim (1.2M+) lacks granular breakdown; unclear what portion is active vs. dormant usage, or whether count includes transitive dependencies.
  • Adoption appears concentrated in Android/JVM; adoption evidence for Ktor or other platforms is thin, limiting liability as Kotlin diversifies.
Prediction

Sandwich likely remains a stable, niche library for Android/Retrofit workflows where sealed response types are valued. Multiplatform expansion may accelerate adoption if Kotlin ecosystem consolidates around shared backend/mobile codebases. Unlikely to displace stdlib Result or become category leader, but may solidify as preferred choice within teams already committed to Kotlin idioms and skydoves ecosystem.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

Kotlin
100%

Information

Language
Kotlin
License
Apache-2.0
Last updated
10h ago
Created
75mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

skydoves

skydoves/landscapist

Landscapist is a pluggable, optimized image loading library for Jetpack Compose...

2.6k Kotlin Mobile
skydoves

skydoves/FlexibleBottomSheet

FlexibleBottomSheet is a Kotlin Compose Multiplatform library that provides...

1.1k Kotlin Mobile
square

square/retrofit

Retrofit is a type-safe HTTP client library for Android and Java that...

43.9k HTML Dev Tools
skydoves

skydoves/Balloon

Balloon is a sophisticated tooltip library for Android and Jetpack Compose that...

4k Kotlin Mobile
skydoves

skydoves/Cloudy

Cloudy is a Kotlin Multiplatform library for Jetpack Compose that provides...

1.2k Kotlin Mobile
vs. alternatives
Result<T> / Arrow

Arrow provides comprehensive functional programming abstractions; Sandwich is lighter, HTTP-focused, more integrated with Retrofit/Ktor. Arrow wider scope, Sandwich narrower and easier onboarding.

Retrofit's built-in Response<T>

Sandwich wraps and abstracts Retrofit's Response; native Response forces manual error parsing. Sandwich reduces boilerplate but adds dependency.

Ktor's built-in HttpResponse

Similar relationship; Sandwich standardizes error/success patterns across Retrofit and Ktor. Ktor-native code needs no wrapper.

Kotlin Result<T> (stdlib)

Stdlib Result is general-purpose; Sandwich adds HTTP semantics (serialization errors, server errors, exception chaining). Sandwich more specialized.

Custom Result/Resource wrappers

Many projects roll their own; Sandwich offers battle-tested alternative with global handlers and multiplatform support, reducing wheel-reinvention.