Moshi HashMap deserializer

前端 未结 1 1160
星月不相逢
星月不相逢 2021-01-19 06:41

I don\'t know if it is possible to deserialise arrays into hashMap i have got json :

\"additionalProperties\": [
{
  \"$type\": \"Tfl.Api.Presentation.Entit         


        
相关标签:
1条回答
  • 2021-01-19 07:01

    Moshi supports fields declared as Map but not as HashMap. This way Moshi can use a different implementation of Map that’s more appropriate than HashMap for decoded JSON. If you change your field’s type to Map<String,AdditionalProperties> it should work.

    0 讨论(0)
提交回复
热议问题