openapi-processor-json

badge License Apache%202.0 blue openapi processor json?label=Maven%20Central

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.

Getting Started

Configuration is identical to the other processors.

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 the openapi.yaml file and the main input for the processor.

  • targetDir: (required) the output folder for generating the openapi.json file.

Sample

See the spring-mvc-boot-4-packages-kt samle project.