This maven plugin allows you to generate the OpenAPI Schema on build.
Add this to your pom.xml:
<plugin>
<artifactId>smallrye-open-api-maven-plugin</artifactId>
<groupId>io.smallrye</groupId>
<executions>
<execution>
<goals>
<goal>generate-schema</goal>
</goals>
</execution>
</executions>
</plugin>
The schema will appear as target/generated/openapi.yaml
and target/generated/openapi.json
by default.
-
outputDirectory
- To override the defaulttarget/generated/
outputDirectory where the json and yaml files will be created. -
schemaFilename
- To override the defaultopenapi
filename. This will be the name without the extension. -
scanDependenciesDisable
- Disable scanning the project’s dependencies for OpenAPI model classes too. False by default. -
includeDependenciesScopes
- If the aboveincludeDependencies
is true, you can control what scopes should be included. Default iscompile, system
-
includeDependenciesTypes
- If the aboveincludeDependencies
is true, you can control what types should be included. Default isjar
-
configProperties
- Load any properties from a file. Example${basedir}/src/main/resources/application.properties
All properties from the MicroProfile OpenAPI Spec is supported. Properties set here will override the properties from configProperties
.
-
modelReader
-
filter
-
scanDisabled (true/false)
-
scanPackages (regex)
-
scanClasses (regex)
-
scanExcludePackages (regex)
-
scanExcludeClasses (regex)
-
servers (comma-separated)
-
pathServers (comma-separated)
-
operationServers (comma-separated)
All properties from the SmallRye OpenAPI Implementation is supported. Properties set here will override the properties from configProperties
.
-
scanDependenciesDisable (true/false)
-
scanDependenciesJars (comma-separated)
-
schemaReferencesEnable (true/false)
-
customSchemaRegistryClass
-
applicationPathDisable (true/false)
-
openApiVersion
-
infoTitle
-
infoVersion
-
infoDescription
-
infoTermsOfService
-
infoContactEmail
-
infoContactName
-
infoContactUrl
-
infoLicenseName
-
infoLicenseUrl
-
operationIdStrategy (METHOD/CLASS_METHOD/PACKAGE_CLASS_METHOD)