public struct Result: Codable {
public let user: User
public let lib: Lib
public let text: String
public struct User: Codable {
public let name: String
private enum CodingKeys: String, CodingKey {
case name = "Name"
}
}
public struct Lib: Codable {
public let libName: String
public let year: Int
public let version: String
public let released: String
private enum CodingKeys: String, CodingKey {
case libName = "lib-name"
case year
case version
case released
}
}
}
JSONtoCodable is a generating tool from Raw JSON to Codable (Swift4) text written in Swift4.
Qiita: JSONからCodable化されたstructを自動生成するツールを作った話 - Qiita
TL;DR
From JSON,
to Codable.
JaCo (macOS App)
jc (CLI App)
Installation
Usage example
or generate .swift file,
Help command
Screen shot
Support formats
Translations
Usage
Config
See more: Config.swift
Installation
Cocoapods
Add this to your Podfile:
and
Carthage
Add this to your Cartfile:
and
License
JSONtoCodable is available under the MIT license.