项目作者: chrisbarbour

项目描述 :
JSON Schema -> Kotlin Data classes with validation
高级语言: Kotlin
项目地址: git://github.com/chrisbarbour/json-sckema.git
创建时间: 2018-06-21T09:24:33Z
项目社区:https://github.com/chrisbarbour/json-sckema

开源协议:Apache License 2.0

下载


JSON SCKEMA

Generation of kotlin data classes from Json-schema

Get Started

Using Maven

Using Maven you can generate kotlin data classes using the maven-exec-plugin.
The following is an example of how you can generate classes from definitions within a swagger definition file.

  1. <plugin>
  2. <groupId>org.codehaus.mojo</groupId>
  3. <artifactId>exec-maven-plugin</artifactId>
  4. <version>1.4.0</version>
  5. <executions>
  6. <execution>
  7. <phase>generate-sources</phase>
  8. <goals>
  9. <goal>java</goal>
  10. </goals>
  11. <configuration>
  12. <mainClass>sckema.SchemaMapperKt</mainClass>
  13. <arguments>
  14. <argument>${project.build.directory}/generated-sources/</argument>
  15. <argument>product</argument>
  16. <argument>yaml</argument>
  17. <argument>${project.basedir}/src/main/resources/swagger.yml</argument>
  18. </arguments>
  19. </configuration>
  20. </execution>
  21. </executions>
  22. </plugin>