Skip to content

pablobarcos/json2SwiftClass

Repository files navigation

json2SwiftClass

Convert a .json file to a swift decodable class

Usage

  1. Download the project.

  2. Open the terminal.

  3. Navigate to project directory.

  4. Enter:

./json2SwiftClass "{input .json path}" "{output path}/SwiftClass.swift"
  1. Open the new SwiftClass.swift created in the output path directory

Change the code

  1. Change the code of the json2SwiftClass.swift

  2. Delete json2SwiftClass exe

  3. Open the terminal.

  4. Navigate to project directory.

  5. Enter:

cat AnyCodable.swift json2SwiftClass.swift | swiftc - 
  1. Rename "main" exe to "json2SwiftClass"

  2. Do steps: 4,5 of Usage

About

Convert a .json file to a swift decodable class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages