swaggerwildfly-swarm

How to use Swagger in non-trivial Wildfly Swarm project?


In a very simple Wildfly Swarm project Swagger works fine and produces the expected swagger.json output. But as soon as a second java package is added to the project, it doesn't work anymore.

Example (see https://github.com/pe-st/swagger42 example project):

What has to be done to make Swagger work in projects like these?


Solution

  • https://wildfly-swarm.gitbooks.io/wildfly-swarm-users-guide/advanced/swagger.html

    Create a file META-INF/swarm.swagger.conf

    and add following entry:

    packages:ch.schlau.pesche.swagger42.rest
    

    There is a info in the startup:

    [org.wildfly.swarm.swagger] (main) WFSSWGR0004: Configure Swagger for deployment 
    demo.war with package ch.schlau.pesche.swagger42.core
    

    or similar, which packages is scanned.