在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):jsonschema2dataclass/js2d-gradle开源软件地址(OpenSource Url):https://github.com/jsonschema2dataclass/js2d-gradle开源编程语言(OpenSource Language):Kotlin 100.0%开源软件介绍(OpenSource Introduction):jsonschema2pojo Gradle pluginExtendedIntroductionThis plugin is aiming to take raw JSON or YAML raw files or schemas and convert to Java or Scala POJOs (Plain Old Java Object). Currently it suppots features like generating using Jackson, GSON and Mocha1 annotations and JSR305. Please note, that JSR305 is purely supported, and present only if you don’t want to use a proper JSON validation for some reasons. Adding a plugin to your build.gradleplugins {
id "org.jsonschema2dataclass" version "$latestRelease"
} Please refer Gradle Plugins page for further details. Usage ExampleUsage for Android and for Java is basically the same. You need to declare plugin usage and configure plugin parameters if needed. To execute just a java classes generation you need to run To start using a plugin you need follow this recipe: Minimal java example how to use the plugin
plugins{
id "org.jsonschema2dataclass" version "$latestRelease"
}
jsonSchema2Pojo {
targetPackage = 'org.example.api' // specify package for your needs
source.setFrom files("${project.rootDir}/src/main/resources/json")
// ... — add other supported options as you need
} Additionally you can copy one of sample Java (Kotlin and Groovy DSL) and Android (AGP 3, AGP 4 and AGP 7) projects you can find in demo folder 专题导读
热门推荐
热门话题
阅读排行榜
|
请发表评论