JSON Schema file generator
This Maven plugin generates JSON-Schema files from POJOs using Jackson.
Prerequisites
- Java 8 or higher
- Maven 3.6.2 or higher
- Jackson in dependencies
- Model classes annotated with @HyperSchema
Usage
<plugins>
<!-- your other plugins -->
<plugin>
<groupId>de.isc-software.maven</groupId>
<artifactId>json-schema-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<packagesToScan>
<item>your.domain</item>
<item>your.other.domain</item>
</packagesToScan>
<baseClassName>your.domain.base.Thing</baseClassName>
<outputDirectory>META-INF/json-schema</outputDirectory>
</configuration>
<executions>
<execution>
<id>build-json-schema</id>
<phase>process-classes</phase>
<goals>
<goal>json-schema</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
Goals and phase
- json-schema is the only goal.
- process-classes is the mandatory lifecycle phase for this plugin.
Configuration
Name | Description |
---|---|
packagesToScan | A list of packages, where your model classes exist |
baseClassName | Fully qualified name of the base class of your model classes |
outputDirectory | Output directory name, relative to Mavens output path |
History
Created for use in some RESTFull API projects, where it proofed helpful.
Notes
For release in Maven repository create signatures:
gpg -ab json-schema-maven-plugin-VERSION.jar
gpg -ab json-schema-maven-plugin-VERSION-javadoc.jar
gpg -ab json-schema-maven-plugin-VERSION-sources.jar