java Json 到 kotlin 数据类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40391434/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Json to kotlin data classes
提问by Gorets
Is there existing service for generating kotlin data classes from json model in the way how it works on http://www.jsonschema2pojo.org/site? My new project has over complicated API responses, so it would save me time.
是否存在从 json 模型生成 kotlin 数据类的现有服务,其工作方式与http://www.jsonschema2pojo.org/站点上的工作方式相同?我的新项目有过于复杂的 API 响应,因此可以节省我的时间。
回答by u5167396
There is a plugin for Android Studio and Intellij Idea called JsonToKotlinClass.
有一个适用于 Android Studio 和 Intellij Idea 的插件,名为JsonToKotlinClass。
You can convert json
into kotlin's data class
with it: https://github.com/wuseal/JsonToKotlinClass
你可以用它转换json
成 kotlin 的data class
:https: //github.com/wuseal/JsonToKotlinClass