I'm trying to generate a single OpenAPI YAML file in an aggregator module that imports other Micronaut modules as dependencies.
Context
I have multiple modules (A, B, C) that define Micronaut controllers.
When I run mvn package on each of them, Micronaut OpenAPI generates YAML files like openapi-A.yml, openapi-B.yml, etc., in:
target/classes/META-INF/swagger/These modules are then imported as dependencies in a new module (Aggregator Module).
After building the aggregator module, I confirmed that all the YAML files are present in its JAR under
META-INF/swagger/(using jar tf).Now I want Micronaut to merge those YAMLs into a single OpenAPI file for the aggregator module.
What I tried
- I created a
openapi.propertiesfile in the aggregator module with:
micronaut.openapi.additional.files=classpath:META-INF/swagger
- I set the output path:
micronaut.openapi.target.file=META-INF/swagger/openapi.yml
Despite this, no merged YAML file is generated during the build of the aggregator module. The build completes with no errors, but the output file is missing.
Am I misconfiguring something? Is there a specific format, location, or phase required for micronaut.openapi.additional.files to properly detect and merge YAMLs from dependent modules?