Description
j2s is a small macOS app that converts JSON into Swift structs. You give it a JSON file, and it writes Codable-compliant Swift structs, either into one file or into a separate file for each struct. It turns snake_case keys into camelCase property names, and for keys whose value is an array of dictionaries it singularises the name to use for the struct. A string that is an ISO 8601 date becomes a Date, a whole number becomes an Int and a decimal number becomes a Double. The README explains how optional properties are handled when the same struct appears more than once while parsing. The author says the app does only this conversion and suggests a tool such as Sourcery for anything else. The project needs Swift 4 and Xcode 9 or later to build, and the generated code also targets Swift 4. Support for Swift 3 is only in older commits in the project history. It is aimed at iOS and macOS developers who would rather not write model structs by hand. The source is public on GitHub.…
Highlights
- Converts JSON into Codable Swift structs
- Writes one file or one file per struct
- Converts snake_case keys to camelCase
- Recognises ISO 8601 dates, integers and decimals
- Native macOS app
Ratings & Reviews
No ratings yet
Be the first to rate J2s.
People also visit
SwiftyJSONAccelerator
macOS app to generate Swift 5 code for models from JSON (with Codeable)
J2s FAQ
What does j2s do?
It converts JSON dictionaries into Swift structs that conform to Codable.
Can it do anything else?
No. The author says it only does this conversion and suggests Sourcery for other needs.
Which Swift version does it need?
The project needs Swift 4 and Xcode 9 or later, and the generated code also targets Swift 4.
How are dates and numbers handled?
ISO 8601 date strings become Date, integers become Int and decimal numbers become Double.
Where is the source?
The project is public on GitHub under the zadr account.
What are the best J2s alternatives?
Popular alternatives to J2s include SwiftyJSONAccelerator, JSON Codable and Swiftify. See all J2s alternatives





