Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Open Source Apps
  3. j2s

j2s

NOASSERTIONSwift

A macOS app that converts JSON dictionaries into Codable-compliant Swift structs.

GitHubGitHub
237 stars13 forks0 contributors

What is j2s?

j2s is a macOS application that converts JSON data into Swift structs with Codable compliance. It automates the creation of Swift models from JSON dictionaries, handling type inference, naming conventions, and date formatting to reduce manual coding effort. The tool is specifically built for macOS and integrates seamlessly with Swift development workflows.

Target Audience

Swift developers working on macOS who need to quickly generate Codable-compliant structs from JSON data, particularly those building apps that consume JSON APIs or handle configuration files.

Value Proposition

Developers choose j2s for its simplicity, accuracy in type mapping, and native macOS integration, offering a lightweight alternative to more complex code generation tools while fully supporting Swift's Codable system.

Overview

A macOS app to convert JSON to Swift structs

Use Cases

Best For

  • Generating Swift Codable models from JSON API responses
  • Converting configuration JSON files into Swift structs
  • Automating model creation for Swift-based macOS apps
  • Handling JSON with nested dictionaries and arrays in Swift
  • Quickly prototyping Swift apps with structured data
  • Ensuring consistent naming conventions (snake_case to camelCase) in Swift code

Not Ideal For

  • Cross-platform development teams requiring JSON-to-Swift conversion on Windows or Linux
  • Projects needing advanced code generation with custom annotations or business logic beyond basic structs
  • Scenes where accurate pluralization for irregular nouns is critical, as j2s uses naive depluralization

Pros & Cons

Pros

Intelligent Naming Conventions

Automatically converts snake_case JSON keys to camelCase Swift properties and depluralizes array key names, as implemented in StringTransformations.swift.

Accurate Type Mapping

Correctly infers Swift types from JSON, including integers as Int, floats as Double, and ISO8601 date strings as Date, ensuring seamless Codable integration.

Codable Compliance

Generates Swift structs that are fully Codable-compliant, with built-in extensions for easy decoding using JSONDecoder, as shown in the example output.

Flexible Output Options

Allows output to a single file or multiple files for each generated struct, providing adaptability in code organization.

Cons

macOS-Exclusive Limitation

j2s is only available for macOS, making it unusable for developers on other operating systems or in headless CI/CD environments.

Imperfect Depluralization

The depluralization logic is naive and can produce incorrect type names, such as turning 'matrices' into 'matrex', as admitted in the README.

Basic Optional Inference

Optional properties are inferred only when keys are missing or null across multiple JSON samples, which may not handle all edge cases reliably.

Limited Date Format Support

Only ISO8601 date strings are recognized and mapped to Date types; other common formats require manual adjustment or external tools.

Frequently Asked Questions

Quick Stats

Stars237
Forks13
Contributors0
Open Issues5
Last commit6 months ago
CreatedSince 2017

Tags

#developer-tools#model-generation#swift-4#macos-app#xcode#code-generation

Built With

X
Xcode
S
Swift

Included in

Open Source Apps48.1k
Auto-fetched 16 hours ago

Related Projects

JSONExportJSONExport

JSONExport is a desktop application for Mac OS X which enables you to export JSON objects as model classes with their associated constructors, utility methods, setters and getters in your favorite language.

Stars4,810
Forks789
Last commit2 years ago
JSON to Model classJSON to Model class

MacOS app for Generating JSON classes (Template based)

Stars99
Forks16
Last commit4 years ago
JSON MapperJSON Mapper

A simple macOS app to generate Swift Object Mapper classes from JSON

Stars27
Forks3
Last commit9 years 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