Convert a .json file to a swift decodable class
-
Download the project.
-
Open the terminal.
-
Navigate to project directory.
-
Enter:
./json2SwiftClass "{input .json path}" "{output path}/SwiftClass.swift"
- Open the new SwiftClass.swift created in the output path directory
-
Change the code of the json2SwiftClass.swift
-
Delete json2SwiftClass exe
-
Open the terminal.
-
Navigate to project directory.
-
Enter:
cat AnyCodable.swift json2SwiftClass.swift | swiftc -
-
Rename "main" exe to "json2SwiftClass"
-
Do steps: 4,5 of Usage