The request parsing seems to fail on certain areas, not sure if all as I haven't completely implemented my client, such as Statuses being parsed correctly through Timelines and Notifications, and Clients.register.
It seems to fail on the array.flatMap(Status.init), although this never seemed a problem before and worked correctly, I guess a recent API change from Mastodon could be to blame, hence breaking parsing?
For example here is a basic return from my debugging, showing there are 20 statuses being returned, however the flatMap produces none.
array [JSONDictionary] 20 values
(json as? [JSONDictionary]) [JSONDictionary]? 20 values some
print((json as [JSONDictionary])[0] as? [String: Any]) ()
array.flatMap(Status.init) [MastodonKit.Status] 0 values
Optional(["sensitive": 0, "emojis": <__NSArray0 0x60000000ecc0>(
)
, "reblog": <null>, "media_attachments": <__NSArray0 0x60000000ecc0>(
)
, "uri": https://niu.moe/users/ivesen/statuses/98818207067203544, "favourites_count": 0, "language": <null>, "muted": 0, "reblogged": 0, "tags": <__NSArray0 0x60000000ecc0>(
)
, "visibility": public, "mentions": <__NSSingleObjectArrayI 0x60400000f920>(
{
acct = "[email protected]";
id = 178083;
url = "https://niu.moe/@Pasty";
username = Pasty;
}
)
, "application": <null>, "content": <p><span class="h-card"><a href="https://niu.moe/@Pasty" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>Pasty</span></a></span> sleep tight chloe</p>, "spoiler_text": , "reblogs_count": 0, "id": 98818207199477749, "in_reply_to_account_id": 178083, "in_reply_to_id": 98818204421709969, "favourited": 0, "created_at": 2017-10-12T22:09:39.193Z, "account": {
acct = "[email protected]";
avatar = "https://files.mastodon.social/accounts/avatars/000/124/963/original/11c4a9fb168911ed.png";
"avatar_static" = "https://files.mastodon.social/accounts/avatars/000/124/963/original/11c4a9fb168911ed.png";
"created_at" = "2017-04-30T12:57:50.430Z";
"display_name" = ivesen;
"followers_count" = 97;
"following_count" = 51;
header = "https://files.mastodon.social/accounts/headers/000/124/963/original/f44ea559134c2ec6.jpg";
"header_static" = "https://files.mastodon.social/accounts/headers/000/124/963/original/f44ea559134c2ec6.jpg";
id = 124963;
locked = 0;
note = "<p>I forgot how to sleep at some point</p><p><a href=\"https://niu.moe/tags/nobot\" class=\"mention hashtag\" rel=\"nofollow noopener\" target=\"_blank\">#<span>nobot</span></a></p>";
"statuses_count" = 3306;
url = "https://niu.moe/@ivesen";
username = ivesen;
}, "url": https://niu.moe/@ivesen/98818207067203544])
2017-10-12 23:22:19.402244+0100 Swiftty[67435:57645193] TIC Read Status [1:0x60000016ff00]: 1:57
2017-10-12 23:22:19.402393+0100 Swiftty[67435:57645193] TIC Read Status [1:0x60000016ff00]: 1:57
Optional(["sensitive": 0, "emojis": <__NSArray0 0x60000000ecc0>(
)
, "reblog": <null>, "media_attachments": <__NSArray0 0x60000000ecc0>(
)
, "uri": https://niu.moe/users/ivesen/statuses/98818207067203544, "favourites_count": 0, "language": <null>, "muted": 0, "reblogged": 0, "tags": <__NSArray0 0x60000000ecc0>(
)
, "visibility": public, "mentions": <__NSSingleObjectArrayI 0x60400000f920>(
{
acct = "[email protected]";
id = 178083;
url = "https://niu.moe/@Pasty";
username = Pasty;
}
)
, "application": <null>, "content": <p><span class="h-card"><a href="https://niu.moe/@Pasty" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>Pasty</span></a></span> sleep tight chloe</p>, "spoiler_text": , "reblogs_count": 0, "id": 98818207199477749, "in_reply_to_account_id": 178083, "in_reply_to_id": 98818204421709969, "favourited": 0, "created_at": 2017-10-12T22:09:39.193Z, "account": {
acct = "[email protected]";
avatar = "https://files.mastodon.social/accounts/avatars/000/124/963/original/11c4a9fb168911ed.png";
"avatar_static" = "https://files.mastodon.social/accounts/avatars/000/124/963/original/11c4a9fb168911ed.png";
"created_at" = "2017-04-30T12:57:50.430Z";
"display_name" = ivesen;
"followers_count" = 97;
"following_count" = 51;
header = "https://files.mastodon.social/accounts/headers/000/124/963/original/f44ea559134c2ec6.jpg";
"header_static" = "https://files.mastodon.social/accounts/headers/000/124/963/original/f44ea559134c2ec6.jpg";
id = 124963;
locked = 0;
note = "<p>I forgot how to sleep at some point</p><p><a href=\"https://niu.moe/tags/nobot\" class=\"mention hashtag\" rel=\"nofollow noopener\" target=\"_blank\">#<span>nobot</span></a></p>";
"statuses_count" = 3306;
url = "https://niu.moe/@ivesen";
username = ivesen;
}, "url": https://niu.moe/@ivesen/98818207067203544])