Skip to content

Instantly share code, notes, and snippets.

@rwbutler
Created August 21, 2020 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwbutler/6d5bfad21d4edd62c41dbf470c257f6d to your computer and use it in GitHub Desktop.
Save rwbutler/6d5bfad21d4edd62c41dbf470c257f6d to your computer and use it in GitHub Desktop.
json-key-decoding-vehicle-decode-3.swift
let jsonData = try Data(contentsOf: jsonResourceURL)
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromKebabCase
let vehicles try decoder.decode(Vehicles.self, from: jsonData)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment