# Flight-School/AnyCodable

Type-erased wrappers for Encodable, Decodable, and Codable values

Repository: https://github.com/Flight-School/AnyCodable
Canonical: https://ross.abutalabs.com/products/anycodable
Homepage: https://flight.school/books/codable
Language: Swift
License: MIT
License Family: permissive
Topics: swift, codable, decoding, encoding
Archived: true
Last push: 2024-08-06T22:58:24+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3054, "days_push": 757, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1332, forks 151 (observed 2026-08-28T04:04:24.515483+00:00)

## What it is
A Swift library providing type-erased wrappers (AnyEncodable, AnyDecodable, AnyCodable) for encoding and decoding heterogeneous values with Swift's Codable system. It enables working with dynamic JSON-like structures where value types are not known at compile time.

## Use cases
- encode a dictionary with mixed value types to JSON in Swift
- decode arbitrary JSON without defining concrete Codable structs
- handle dynamic JSON payloads with unknown schema
- store heterogeneous values in a Codable container
- pass mixed-type data through Swift Codable APIs

## When to choose
- you need to encode or decode JSON with dynamic or unknown structure in Swift
- you want a small, MIT-licensed, dependency-free Codable helper
- you're building Swift server-side or iOS apps that consume loosely-typed APIs

## When to avoid
- you have well-defined schemas and can model responses with concrete Codable types
- you need advanced JSON path queries or manipulation rather than simple encode/decode
- you're not working in Swift or with the Codable ecosystem

## Facets
- artifact type: library
- maturity: stable
- function: serialization
- domain: developer-tools, backend, apis
- platform: cross-platform
- tags: codable, type-erasure, swift-package-manager, cocoapods, carthage, swift, ios, macos

## Member repositories
- Flight-School/AnyCodable (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:24.515483+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:44:56.606182+00:00, confidence not recorded.
  - readme: https://github.com/Flight-School/AnyCodable (fetched 2026-08-28T04:04:24.515483+00:00, sha 667c3ff54bb8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
