quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

Default Swift output refers to undefined 'newJSONDecoder' value

Open dvdsgl opened this issue 6 years ago • 1 comments

  • Sample: https://app.quicktype.io?share=nrNqOMPUlJztawoKIlwq

Default Swift output has a comment referring to newJSONDecoder, which is not defined.

// This file was generated from JSON Schema using quicktype, do not modify it directly.
// To parse the JSON, add this file to your project and do:
//
//   let welcome = try? newJSONDecoder().decode(Welcome.self, from: jsonData)

import Foundation

// MARK: - Welcome
struct Welcome: Codable {
    let greeting: String
    let instructions: [String]
}

dvdsgl avatar Jun 21 '19 04:06 dvdsgl

I just noticed this myself -- nearly 3 years later 😅

pepas-everly avatar May 03 '22 17:05 pepas-everly

I just found this as it's the top result for "newJSONDecoder" on Google

radiocolin avatar Oct 10 '22 17:10 radiocolin