steamclock / netable

A Swift library for encapsulating network APIs using Codable in a type-oriented way.
MIT License
99 stars 3 forks source link

Add `jsonDecodingStrategy` support to `SmartUnwrap` requests. #110

Closed amyoulton closed 1 year ago

amyoulton commented 1 year ago

In Netable's current setup, you cannot provide a custom jsonKeyDecodingStrategy within a request when you are also using SmartUnwrap. It throws this error (example from trying to decode User): Decoding Error: Resource Extraction Error: The raw result could not be turned into the final resource: Failed to unwrap type User from SmartUnwrap response. Couldn\'t decode object for key user. `

The reason is that we literally didn't add the check within the SmartUnwrap request:

Screenshot 2022-12-14 at 3 09 07 PM

We need to add support to allow this!