A macOS app that converts JSON dictionaries into Codable-compliant Swift structs.
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.
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.
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.
A macOS app to convert JSON to Swift structs
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically converts snake_case JSON keys to camelCase Swift properties and depluralizes array key names, as implemented in StringTransformations.swift.
Correctly infers Swift types from JSON, including integers as Int, floats as Double, and ISO8601 date strings as Date, ensuring seamless Codable integration.
Generates Swift structs that are fully Codable-compliant, with built-in extensions for easy decoding using JSONDecoder, as shown in the example output.
Allows output to a single file or multiple files for each generated struct, providing adaptability in code organization.
j2s is only available for macOS, making it unusable for developers on other operating systems or in headless CI/CD environments.
The depluralization logic is naive and can produce incorrect type names, such as turning 'matrices' into 'matrex', as admitted in the README.
Optional properties are inferred only when keys are missing or null across multiple JSON samples, which may not handle all edge cases reliably.
Only ISO8601 date strings are recognized and mapped to Date types; other common formats require manual adjustment or external tools.