0

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

  1. I created a openapi.properties file in the aggregator module with:
micronaut.openapi.additional.files=classpath:META-INF/swagger
  1. 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?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.