steamclock / netable

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

Revert "Changed Request encoding/decoding to non-optional with default param" #111

Closed amyoulton closed 1 year ago

amyoulton commented 1 year ago

Reverts steamclock/netable#109

@brendanlensink I am reverting this because I found a decent issue that comes along with implementing this.

Currently we have two places that we can set encoding/decoding, the request itself or the netable implementation configurations. Currently, we're checking if there is a strategy within the individual request existing and if it doesn't exist, it defaults to the config one, which is set to use default keys.

Since we removed the optional, this would never happen, which means that config option is rendered useless.

I think we need to rethink how we want to solve this issue as to not affect the current structure of Config being the base decoding/encoding strategy which is overridden by a requests if it exists! My gut tells me that we are going to want to keep it optional because this structure currently makes a lot of sense, but then I'm unsure how to handle that error we encountered.

brendanlensink commented 1 year ago

Huh shoot, you're right. Okay, lets revert this, re-open the original ticket and add what we learned at the bottom. we can come back to this later.