swift-codable-json

Installation
SKILL.md

Swift Codable for JSON Parsing

Overview

Codable provides type-safe JSON parsing but strict typing means any mismatch crashes decoding. One date strategy per decoder, CodingKeys for every naming mismatch, custom decoders for nested structures.

Core principle: Design for API reality (not ideal JSON), fail gracefully with error handling, use optionals for unreliable data.

Basic Patterns

Pattern 1: Simple Mapping

// JSON: {"id": 123, "name": "Alice", "email": "alice@example.com"}

struct User: Codable {
    let id: Int
    let name: String
    let email: String
Related skills

More from dagba/ios-mcp

Installs
21
Repository
dagba/ios-mcp
GitHub Stars
3
First Seen
Jan 23, 2026