https://developer.apple.com/documentation/foundation/jsondecoder
JSONDecoderとかは型を引数としてとります。
let decoder = JSONDecoder()
let product = try decoder.decode(GroceryProduct.self, from: json)
これでJSONがDecodable準拠しているGroceryProductにマッピングされてGroceryProductのインスタンスが返ります。とか。