Search code examples
jakarta-eewildflyopenapijava-ee-8microprofile

Using smallrye-open-api with Wildfly 20 and multiple war files deployed to same server


I am trying to use smallrye-open-api (MicroProfile OpenAPI) with Wildfly 20. I have multiple war files (modules) deployed on one wildfly instance in standalone mode. Is it possible to specify with war file should be covered with open api documentation? I am trying but meet warnings like that

10:59:06,082 WARN  [org.wildfly.extension.microprofile.openapi.smallrye] (MSC service thread 1-5) [] WFLYMPOAI0003: MicroProfile OpenAPI endpoint already registered for host 'default-host'.  Skipping OpenAPI documentation of 'module-1.war'

For all my modules. Seems like Wildfly tries to register OpenAPI endpoint randomly on first met module.


Solution

  • The solution was found. In every module (war file) you should add file

    src/resources/META-INF/microprofile-config.properties
    

    in this file specify unique path where OpenAPI to specific war should be found using property

    mp.openapi.extensions.path=/myWarOpenapiPath
    

    Or if module (war file) shouldn't be covered with OpenAPI documentation just add property

    mp.openapi.extensions.enabled=false
    

    Some info can be found here https://github.com/wildfly/wildfly/blob/master/docs/src/main/asciidoc/_admin-guide/subsystem-configuration/MicroProfile_OpenAPI.adoc