The module provide generation of json schemas by POJO models with using "javax.validation"
execute generation: mvn json-schema-generator:generate
add plugin in pom
configuration example:
<project>
<build>
<plugins>
<plugin>
<groupId>io.github.phantomstr.testing-tools</groupId>
<artifactId>json-schema-generator</artifactId>
<version>1.0.2-SNAPSHOT</version>
<configuration>
<packages>
<package>my.project.models</package>
</packages>
<includes>
<include>Dto.*</include>
<include>.*Model</include>
</includes>
<excludes>
<exclude>.*Assert</exclude>
</excludes>
<targetDirectory>/src/main/resources/model/schema</targetDirectory>
<pojoClassesDirectory>${project.build.outputDirectory}</pojoClassesDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
package - using for filtering classes.
If found class start with one of package - it will be used for generation.
default value "**" - all packages will be involved in generation
include - using for filtering classes.
If a class match is found with one of the "include" regular expressions, it will be used for generation.
default value "**" - all packages will be involved in generation
exclude - using for filtering classes.
If a class match is found with one of the "exclude" regular expressions, it will be ignored.
default value "" - all packages will be involved in generation
targetDirectory - path to directory for schemas generation.
defaultValue = ${project.build.sourceDirectory}/schemas
pojoClassesDirectory - root directory with generated classes for models
default value "${project.build.outputDirectory}"
- Classes for that schemas are generating should be already compiled
- Maven - Dependency Management
We use SemVer for versioning.