Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Swift
  3. YamlSwift

YamlSwift

MITSwift

A Swift library for parsing YAML and JSON documents into a type-safe Yaml enum.

GitHubGitHub
413 stars98 forks0 contributors

Overview

Load YAML and JSON documents using Swift

Use Cases

Not Ideal For

  • Applications that need to serialize Swift objects back to YAML or JSON strings, as YamlSwift only supports parsing.
  • Projects requiring incremental or streaming parsing of large YAML files to minimize memory usage.
  • Teams using advanced YAML features like custom tags, anchors, or multi-document streams beyond basic support.

Pros & Cons

Pros

Type-Safe Enum Design

Represents YAML/JSON values as a Swift enum (e.g., .bool, .int), ensuring compile-time safety and reducing runtime errors, as shown in the enum definition.

Intuitive Subscript Access

Allows easy access to nested data using subscript notation like value["key"][0], similar to native Swift collections, demonstrated in the README examples.

Convenient Type Conversions

Provides optional properties such as .bool and .int for safe value extraction without manual casting, enhancing code readability and safety.

Error Handling Support

Load functions throw errors for invalid documents, enabling robust error management with try-catch blocks, as illustrated with parsing failures.

Cons

No Serialization Support

The library lacks built-in methods to convert the Yaml enum back to YAML or JSON strings, which limits its use for generating configuration files or API responses.

Limited Advanced YAML Features

Focuses on core parsing; may not fully support YAML 1.2 specifications or complex constructs like merge keys, which could be a deal-breaker for specialized use cases.

Memory Intensive Parsing

Loads entire documents into memory at once, making it inefficient for very large files compared to streaming parsers that handle data incrementally.

Frequently Asked Questions

Quick Stats

Stars413
Forks98
Contributors0
Open Issues12
Last commit3 years ago
CreatedSince 2014

Tags

#ios#data-serialization#yaml-parser#configuration#type-safe#swift#json-parser#macos

Built With

S
Swift

Included in

Swift26.0k
Auto-fetched 1 day ago

Related Projects

YamsYams

A Sweet and Swifty YAML parser.

Stars1,250
Forks172
Last commit13 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub