-
I'm having troubles using json is
then
then
at which point I'm stuck as I checked every combo but this has been fruitless ;) Of course with Wrapped, there is always a workaround!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @diligiant, Unfortunately I'm out of town, and I'm only now having the chance to catch up with everything. If I got this correctly, I think the best solution would be extending var items: [Media]? {
self["saveMediaResponse"]["items"].array().compactMap {
$0.media.optional().flatMap(Media.init)
?? $0.optional().flatMap(Media.init)
}
} (I haven't checked the actual response model, btw, so apologies if it's not 100%: I'm just basing it off your post) |
Beta Was this translation helpful? Give feedback.
Hey @diligiant,
Unfortunately I'm out of town, and I'm only now having the chance to catch up with everything.
If I got this correctly, I think the best solution would be extending
items
definition like this.(I haven't checked the actual response model, btw, so apologies if it's not 100%: I'm just basing it off your post)