You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
I've checked some structures presented by Foundation framework, and tested them.
There are JSON coders and _PropertyList coders in Foundation framework, so I tested them on JSONEncoder and PropertyListEncoder using this simple script.
And results are below:
AnyEncodable<Array<Int>>
[JSON] PASS.
[PLIST] PASS.
Array
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<Calendar>
[JSON] ERROR.
[PLIST] ERROR.
Calendar
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<CharacterSet>
[JSON] ERROR.
[PLIST] ERROR.
CharacterSet
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<Data>
[JSON] ERROR.
[PLIST] ERROR.
Data
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<Date>
[JSON] PASS.
[PLIST] ERROR.
Date
[JSON] PASS.
[PLIST] ERROR.
AnyEncodable<DateInterval>
[JSON] ERROR.
[PLIST] ERROR.
DateInterval
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<NSDecimal>
[JSON] PASS.
[PLIST] ERROR.
NSDecimal
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<Dictionary<String, Int>>
[JSON] PASS.
[PLIST] PASS.
Dictionary<String, Int>
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<IndexPath>
[JSON] ERROR.
[PLIST] ERROR.
IndexPath
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<IndexSet>
[JSON] ERROR.
[PLIST] ERROR.
IndexSet
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<Locale>
[JSON] ERROR.
[PLIST] ERROR.
Locale
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<Set<Int>>
[JSON] ERROR.
[PLIST] ERROR.
Set<Int>
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<String>
[JSON] PASS.
[PLIST] ERROR.
String
[JSON] PASS.
[PLIST] ERROR.
AnyEncodable<TimeZone>
[JSON] ERROR.
[PLIST] ERROR.
TimeZone
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<URL>
[JSON] PASS.
[PLIST] PASS.
URL
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<UUID>
[JSON] ERROR.
[PLIST] ERROR.
UUID
[JSON] PASS.
[PLIST] ERROR.
According to results, AnyCodable doesn't cover some major types, and it doesn't support PropertyList coders completely.
The text was updated successfully, but these errors were encountered:
I've checked some structures presented by Foundation framework, and tested them.
There are JSON coders and _PropertyList coders in Foundation framework, so I tested them on JSONEncoder and PropertyListEncoder using this simple script.
And results are below:
AnyEncodable<Array>
[JSON] PASS.
[PLIST] PASS.
Array
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
Calendar
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
CharacterSet
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
Data
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] PASS.
[PLIST] ERROR.
Date
[JSON] PASS.
[PLIST] ERROR.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
DateInterval
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] PASS.
[PLIST] ERROR.
NSDecimal
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<Dictionary<String, Int>>
[JSON] PASS.
[PLIST] PASS.
Dictionary<String, Int>
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
IndexPath
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
IndexSet
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
Locale
[JSON] PASS.
[PLIST] PASS.
AnyEncodable<Set>
[JSON] ERROR.
[PLIST] ERROR.
Set
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] PASS.
[PLIST] ERROR.
String
[JSON] PASS.
[PLIST] ERROR.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
TimeZone
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] PASS.
[PLIST] PASS.
URL
[JSON] PASS.
[PLIST] PASS.
AnyEncodable
[JSON] ERROR.
[PLIST] ERROR.
UUID
[JSON] PASS.
[PLIST] ERROR.
According to results, AnyCodable doesn't cover some major types, and it doesn't support PropertyList coders completely.
Thanks for you types.
I re-implemented it to support "exact type", which is that types like UInt won't be implicitly coerced.
Already passed the test using the types you mentioned above, except Calendar and Local. Somehow, even after encoding and decoding using JSONEncoder and JSONDecoder, the result is still not equatable. Any there will be a crash if Calendar and Locale are both supported at the same time. Still needs further researches.
I've checked some structures presented by Foundation framework, and tested them.
There are JSON coders and _PropertyList coders in Foundation framework, so I tested them on JSONEncoder and PropertyListEncoder using this simple script.
And results are below:
AnyEncodable<Array<Int>>
Array
AnyEncodable<Calendar>
Calendar
AnyEncodable<CharacterSet>
CharacterSet
AnyEncodable<Data>
Data
AnyEncodable<Date>
Date
AnyEncodable<DateInterval>
DateInterval
AnyEncodable<NSDecimal>
NSDecimal
AnyEncodable<Dictionary<String, Int>>
Dictionary<String, Int>
AnyEncodable<IndexPath>
IndexPath
AnyEncodable<IndexSet>
IndexSet
AnyEncodable<Locale>
Locale
AnyEncodable<Set<Int>>
Set<Int>
AnyEncodable<String>
String
AnyEncodable<TimeZone>
TimeZone
AnyEncodable<URL>
URL
AnyEncodable<UUID>
UUID
According to results, AnyCodable doesn't cover some major types, and it doesn't support PropertyList coders completely.
The text was updated successfully, but these errors were encountered: