Skip to content

Instantly share code, notes, and snippets.

@jaumevn
Created January 3, 2018 16:41
Show Gist options
  • Save jaumevn/68cb8fc19aa9a2dd15d9d3acb8db283c to your computer and use it in GitHub Desktop.
Save jaumevn/68cb8fc19aa9a2dd15d9d3acb8db283c to your computer and use it in GitHub Desktop.
struct Device: Codable {
var name: String
var manufacturer: String
}
struct User: Encodable {
var name: String
var username: String
var phoneNumber: String
var devices: [Device]
enum CodingKeys: String, CodingKey {
case name
case username
case phoneNumber = "phone_number"
case devices
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment