🥪 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
5
Open issues
14
Contributors
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.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
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.
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.
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.
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.
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.
Not documented in README. Dedicated sandwich-test artifact mentioned but internal coverage unknown. Build badge present, suggesting CI/CD enforcement, but granularity unclear.
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.
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
- 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.
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.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- Kotlin
- License
- Apache-2.0
- Last updated
- 10h ago
- Created
- 75mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Top contributors
Recent releases
Similar repos
skydoves/landscapist
Landscapist is a pluggable, optimized image loading library for Jetpack Compose...
skydoves/FlexibleBottomSheet
FlexibleBottomSheet is a Kotlin Compose Multiplatform library that provides...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
1.8k | +2 | Kotlin | 8/10 | 10h ago |
|
|
2.6k | — | Kotlin | 8/10 | 2d ago |
|
|
1.1k | — | Kotlin | 8/10 | 1w ago |
|
|
43.9k | — | HTML | 9/10 | 2w ago |
|
|
4k | — | Kotlin | 8/10 | 3d ago |
|
|
1.2k | — | Kotlin | 8/10 | 8h ago |
Arrow provides comprehensive functional programming abstractions; Sandwich is lighter, HTTP-focused, more integrated with Retrofit/Ktor. Arrow wider scope, Sandwich narrower and easier onboarding.
Sandwich wraps and abstracts Retrofit's Response; native Response forces manual error parsing. Sandwich reduces boilerplate but adds dependency.
Similar relationship; Sandwich standardizes error/success patterns across Retrofit and Ktor. Ktor-native code needs no wrapper.
Stdlib Result is general-purpose; Sandwich adds HTTP semantics (serialization errors, server errors, exception chaining). Sandwich more specialized.
Many projects roll their own; Sandwich offers battle-tested alternative with global handlers and multiplatform support, reducing wheel-reinvention.
