# MetaCodable

A set of Swift macros that generates a type's Codable implementation, covering flattened nested keys, fallback keys, default values, custom coding strategies, and untagged enums, without hand-written boilerplate.

MetaCodable provides Swift macros that generate a Codable implementation for a type, centered on a Codable macro that assembles the implementation from data supplied by several supporting macros. Individual properties can specify a custom coding key, be read from a nested or flattened key path, or be composed from multiple underlying Codable types.

Further macros add fallback keys for renamed fields, default values used when a key is missing or fails to decode, custom decoding and encoding strategies through a helper-coder protocol, enum and protocol cases identified by a custom key and value, and enums that lack a distinct identifier for each case. Individual properties or cases can be excluded from encoding or decoding, including conditionally, and camelCase properties can work with differently cased coding keys.

It is distributed as a Swift package and requires Swift 5.9 or later.

Website: https://swiftpackageindex.com/SwiftyLab/MetaCodable/main/documentation/metacodable
