Skip to content

Latest commit

 

History

History
33 lines (30 loc) · 1.05 KB

README.md

File metadata and controls

33 lines (30 loc) · 1.05 KB

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.

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.4.0</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>java</goal>
            </goals>
            <configuration>
                <mainClass>sckema.SchemaMapperKt</mainClass>
                <arguments>
                    <argument>${project.build.directory}/generated-sources/</argument>
                    <argument>product</argument>
                    <argument>yaml</argument>
                    <argument>${project.basedir}/src/main/resources/swagger.yml</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>