
a simple OpenAPI YAML to JSON converter. Maybe useful to feed the OpenAPI to an api viewer like Swagger UI.
It is reading the OpenAPI document, bundles it, i.e., it merges all external $ref s into the main document and writes it as JSON to disk.
Gradle example configuration
The Gradle plugin is required to run the processor from a gradle build.
After adding the plugin add an openapiProcessor configuration like the one below to the Gradle build file.
// groovy
openapiProcessor {
json {
processor 'io.openapiprocessor:openapi-processor-json:2026.1'
apiPath = "$projectDir/src/api/openapi.yaml"
targetDir = "$projectDir/build/openapi"
}
}
-
apiPath: (required) the path to theopenapi.yamlfile and the main input for the processor. -
targetDir: (required) the output folder for generating theopenapi.jsonfile.
Sample
See the spring-mvc-boot-4-packages-kt samle project.