Merge pull request #2 from readdle/fix/encoding-set-in-anycodable

Dev: fix missing encoding of Set in AnyCodable
This commit is contained in:
Andriy Druk 2018-10-09 15:55:26 +03:00 committed by GitHub
commit cf5209a46c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -536,6 +536,10 @@ extension JavaEncoder {
fullClassName = ArrayListClassname
storageType = .anyCodable(codable: .array(className: fullClassName))
}
else if anyCodableValue.typeName == AnyCodable.SetTypeName {
fullClassName = HashSetClassname
storageType = .anyCodable(codable: .array(className: fullClassName))
}
else {
fullClassName = package + "/" + anyCodableValue.typeName
storageType = .anyCodable(codable: .object(className: fullClassName))