In a Maven project with Spring Boot, there are several OpenAPI 3.0 specification files. One spec defines all HTTP errors (errors.yml), and the components of errors.yml are referenced in other spec. I want to generate an output spec with all components of errors.yml inside.
Input spec:
schema:
$ref: "errors.yml#/components/schemas/Error"
Wished output spec:
schema:
$ref: "#/components/schemas/Error"
...
Error:
...
I can do it with swagger-codegen-cli:
java -Dfile.encoding=UTF-8 -jar swagger-codegen-cli-3.0.33.jar generate -l openapi-yaml -i search-api-contract/target/expert_api.yml -o . -DoutputFile=search-api-contract/target/expert_api.yml
How to generate one spec with Maven pom.xml?