How to get GSON & Retrofit to serialize and map an array from a JSON response into a String?
- 阅读更多 关于 How to get GSON & Retrofit to serialize and map an array from a JSON response into a String?
问题 I am making an API request which returns some array values. I need to serialize these array values so that I can assign them to their corresponding class attributes (which are String types). Now I know how to use GSON to serialize and deserialize lists, but with Retrofit the mapping is done automatically. This means that if my attribute is of type String, the API call returns the error "Expected a String but received an Array instead". How do I get around this so that I can receive them as