kadir_j
kadir_j

Reputation: 11

Quarkus OpenApi custom filename

I'm using Quarkus with Java 11 and I'm trying to configure the OpenApi specification with Swagger with static files (see link). In the docs of Quarkus it is recommended to use META-INF/openapi.yml but I prefer not the name openapi for the .yml file but the name of my microservice. It is possible only if I configure an additional docs directory with the directory e.g. META-INF. It will scan the desired folder for .yaml/.yaml and/or .json files. But this feels like a workaround to me. Is it possible to configure that Quarkus is scanning for a custom filename instead of a folder?

Upvotes: 1

Views: 915

Answers (1)

jcompetence
jcompetence

Reputation: 8393

It is not a workaround. The standard name of the file is openapi.yml, if you do not want to have it then you need to provide a custom one, under a specific directory. That is how smallrye does it, and Quarkus uses SmallRye

Example:

https://github.com/watermelonjam/openapi-docs-bug

enter image description here

application.yml

quarkus:
  log:
    level: INFO
    min-level: TRACE
    console:
      enable: true
      format: "%d{dd-MM-yyyy HH:mm:ss.SSSZ} [%t] %-5p %c %M - %s%e%n"
    category:
      io.extr.odb:
        level: INFO
  swagger-ui:
    always-include: false
  smallrye-openapi:
    auto-add-security: false
    additional-docs-directory: META-INF/openapi/prod

Folder structure:

resources/META-INF/openapi/prod/someFile.yaml

Upvotes: 1

Related Questions