GetStream / stream-swift

Swift client for Stream API
https://getstream.io
BSD 3-Clause "New" or "Revised" License
35 stars 26 forks source link

Getting parsing error when trying to fetch a single activity #8

Closed deepak-vishwakarma-spok closed 5 years ago

deepak-vishwakarma-spok commented 5 years ago

When I m trying to fetch a activity , parsing getting failed. Below is the error : GetStream.ClientError.jsonDecode("The data couldn’t be read because it isn’t in the correct format.", Optional(Swift.DecodingError.typeMismatch(Swift.Dictionary, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "results", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "actor", intValue: nil)], debugDescription: "Expected to decode Dictionary but found a string/data instead.", underlyingError: nil)))

deepak-vishwakarma-spok commented 5 years ago

When I m trying to fetch a activity , parsing getting failed. Below is the error : GetStream.ClientError.jsonDecode("The data couldn’t be read because it isn’t in the correct format.", Optional(Swift.DecodingError.typeMismatch(Swift.Dictionary, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "results", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "actor", intValue: nil)], debugDescription: "Expected to decode Dictionary but found a string/data instead.", underlyingError: nil)))

buh commented 5 years ago

Hey @deepak-vishwakarma-spok! Could you show me your code with the request and your Activity type?

buh commented 5 years ago

@deepak-vishwakarma-spok I think I found the problem, if your Activity.actor is a User, then the request can't decode it, because the enrich parameter is missing. I'll fix it soon and let you know.

buh commented 5 years ago

Fixed. Please check the new version 1.2.0