
openapi-processor is a small framework that converts an OpenAPI yaml description to an output format.
openapi-processor (short: oap) does currently support the following formats:
-
oap-spring:
an interface & model java code generator for Spring Boot
-
oap-micronaut:
an interface & model java code generator for Micronaut
-
oap-json:
converts the OpenAPI yaml description to json format
running a processor
openapi-processor supports
-
Maven using the openapi-processor-maven plugin
and
-
Gradle using the openapi-processor-gradle plugin
to run any processor.
processor playground
the Playground offers the possibility to play around with the available processors: choose a processor & one of the editable OpenAPI yaml example descriptions and see what the processor generates.
artifact coordinates
The artifacts are available from maven central with the following coordinates:
<dependency>
<groupId>io.openapiprocessor</groupId>
<artifactId>openapi-processor-{project}</artifactId>
<version>{version}</version>
</dependency>
'io.openapiprocessor:openapi-processor-{project}:{version}'
Replace {project} & {version} with the required values.
For example spring, json or maven for {project} and {version} with the version from the corresponding version badge.
patch level bug fixes
| Usually there is no need to worry about this. |
The processors use a common jar (openapi-processor-core) that provides most of the processor logic.
If there is a bug then in most cases it gets fixed in the core library.
It is possible to explicitly add a specific core version as dependency without updating the processor (e.g. openapi-processor-spring).
The only reasons to explicitly add the core jar is to test the fix, or if you are affected by the bug and don’t want to wait for the next release of the processor.
If the bug does not affect you, just ignore it.
Using Maven the core jar can be added to the openapi-processor-maven plugin block in the pom.xml. Replace ${openapiprocessor.core} with the patch level version.
<!-- ... -->
<plugin>
<groupId>io.openapiprocessor</groupId>
<artifactId>openapi-processor-maven-plugin</artifactId>
<version>${openapiprocessor.maven}</version>
<dependencies>
<dependency>
<groupId>io.openapiprocessor</groupId>
<artifactId>openapi-processor-spring</artifactId>
<version>${openapiprocessor.spring}</version>
</dependency>
<dependency>
<groupId>io.openapiprocessor</groupId>
<artifactId>openapi-processor-core</artifactId>
<version>${openapiprocessor.core}</version>
</dependency>
<!-- ... -->
<dependencies>
<!-- ... -->
</plugin>
In the build.gradle.kts add the patch level version to the processor configuration block.
openapiProcessor {
// new dependency setup
// ...
process("spring") {
dependencies {
process("io.openapiprocessor:openapi-processor-spring:{version}")
process("io.openapiprocessor:openapi-processor-core:{core-version}")
}
// ...
}
// ...
// old dependency setup
// ...
process("spring") {
processor("io.openapiprocessor:openapi-processor-spring:{version}")
processor("io.openapiprocessor:openapi-processor-core:{core-version}")
// ...
}
// ...
}