1

I am using Kotlin multiplatform. I am getting object name in Json response. I want to map object name with other name. So I found to use @SerializedName. But it's not working.

It says Unresolved reference: SerializedName.

Feyza
  • 41
  • 5
Rajesh Maurya
  • 3,026
  • 4
  • 19
  • 37

1 Answers1

2

You can use official kotlin native serialization library for multiplatform. How to add and apply the plugin to your project based on which gradle syntax you are using (either "apply plugin" or "plugin{..}") is described here. After adding dependency you can use @SerialName annotation instead of @SerializedName to override object names.

Feyza
  • 41
  • 5