Back to directory

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

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.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.