Search code examples
swaggermicronaut

Setup Swagger Configuration in Micronaut


I have an existing micronaut application, not written by me, which already has a swagger configuration, but is not working and I am trying to understand why.

First looking at the documentation: OpenAPI/Swagger Support

it says that the yaml file will be generated to the META-INF/swagger ... however I can't find that folder in the project.

(The swagger dependencies are defined)

In the project (resources) yaml file there is a configuration:

application:
  api:
    swagger:
      path: /openapi-doc/swagger
      version: 3.22.2
      urls:
        - name: student
          url: /openapi-doc/swagger/student-api.yml
        - name: course
          url: /openapi-doc/swagger/course-api.yml

That means there should be in the project the folder /openapi-doc/ ? or it will be generated automatically? because I couldn't find a folder under that name

Or I need to create the folder in the root project?

So is not going to be generated under the folder META-INF/swagger


Solution

  • That means there should be in the project the folder /openapi-doc/ ?

    No. I don't think that references a project folder. I think that references a URI.

    or it will be generated automatically?

    The docs should be generated automatically if the build is properly configured.

    Or I need to create the folder in the root project?

    I don't think you will need to create anything in the root of the project.