freemanpolys
freemanpolys

Reputation: 1998

Jhipster Swagger configuration

How to override Jhipster swagger configuration in a microservice project to change the /api path in the backend and update gateway Swagger UI accordingly ?

Upvotes: 2

Views: 4529

Answers (2)

francisco neto
francisco neto

Reputation: 807

As of JHipster 7.0, the following changes were made to the backend:

  • swagger maven profile becomes api-docs
  • jhipster.swagger property becomes jhipster.api-docs

In order to enable swagger api and to change the default uri pattern I had to:

1 - Enable the maven api-docs profile

2 - Add the following property under to application.yml (replace with your api path):

jhipster:

  api-docs:
    default-include-pattern: /api-new-path/.*

Upvotes: 0

Ondřej Stašek
Ondřej Stašek

Reputation: 859

Have you tried setting default-include-pattern in swagger section of your config file (probably application.yml)?

Default setting is /api/.*. For my project I changed it to /(api|io)/.* (its a regex) to include api and io paths.

Upvotes: 2

Related Questions