Skip to content

Instantly share code, notes, and snippets.

@RinniSwift
Created April 18, 2019 22:39
Show Gist options
  • Save RinniSwift/4afac14ff428cece61c320c1fc13fe1d to your computer and use it in GitHub Desktop.
Save RinniSwift/4afac14ff428cece61c320c1fc13fe1d to your computer and use it in GitHub Desktop.
struct CollectionInfo: Codable {
let title: String
let productType: String
let variants: [VariantsInfo]
let image: ImageInfo
enum CodingKeys: String, CodingKey {
case title
case productType = "product_type"
case variants
case image
}
}
struct VariantsInfo: Codable {
let title: String
let inventoryQuantity: Int
enum CodingKeys: String, CodingKey {
case title
case inventoryQuantity = "inventory_quantity"
}
}
struct ImageInfo: Codable {
let path: String
enum CodingKeys: String, CodingKey {
case path = "src"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment