a simple OpenAPI yaml to json converter.
The openapi processor [gradle plugin][opa-gradle] is the easiest way to use the yaml to json processor.
The plugin will add an openapiGeneratr configuration block that is used to configure the openapi processors.
Configuration for a specific processor is placed inside it using the processor name (in this case json) as
configuration block name.
openapiProcessor {
json {
processor 'com.github.hauner.openapi:openapi-processor-json:1.0.0.Mx'
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.
See openapi-processor-spring-mvc-sample for a complete working sample of a minimal openapi.yaml.
