hkellaway / Gloss

[Deprecated] A shiny JSON parsing library in Swift :sparkles: Loved by many from 2015-2021
https://hkellaway.github.io/blog/2020/08/30/tale-of-third-parties
MIT License
1.62k stars 142 forks source link

New Swift 4 Types Cause Ambiguous Type Lookups #305

Closed syllabix closed 6 years ago

syllabix commented 6 years ago

First - Excellent Library! - it has been the defacto solution for dealing with JSON at my company.

The following issue may not be categorizable as an issue, but I thought may be worth a discussion as it did have a minor impact on migrating apps to Swift 4.

With Swift 4 officially out, Gloss Encodable and Decodable protocols now conflict with Swift's Encodable and Decodable types. The obvious solution is to use these the fully qualified type name (Gloss.Decodable) - but this addition to Swift might cause problems with adoption, etc with this library moving forward.

Resolving this issue potentially requires a significant design discussion - but once a direction is determined, I'd be happy to assist and issue a PR.

hkellaway commented 6 years ago

i think the simplest course of action would be changing their names (i'd say JSONDecodable and JSONEncodable); until then, Gloss.Decodable and Gloss.Encodable should work for clients.

if you're interested in helping out, there's a swift_4 branch with no activity on it as of yet

stefanomondino commented 6 years ago

It may not be an elegant solution, but I resolved conflicts by placing a typealias Decodable = Gloss.Decodable in one of my files to remove all warnings

hkellaway commented 6 years ago

naming will be updated to JSONDecodable and JSONEncodable as of version 2.0.0-beta.2