问题描述
我正在为我们的 API 优化创建一串数据类
数据类例如:
@MyAnnotation
data class Cast(
@Json(name = "cast_id")
val castId: Int,val name: String,@Json(name = "profile_path")
val profilePath: String?
)
想要的结果:
{"cast_id":1,"name":1,"profile_path":1}
但目前能够生成它
"{"castId":1,"profilePath":1}"
我想访问 @JSON(或@SerializedName) 注释及其值,如何获取?
然后使用 Kotlin 诗人用这个字符串 init 创建类。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)