Generator-jhipster: Springfox 3 upgrade

Created on 20 Jul 2020  路  6Comments  路  Source: jhipster/generator-jhipster

Springfox v3 has finally landed so we can finally migrate.
Things to do:

  • It now supports both MVC and Webflux so we should be able to have the same features for both options (ie remove the specific code we currently have for the reactive option)
  • The Pageable plugin must be reworked to use the new ModelSpecification (I already have it working :smiley: )

Now the question is : should we also migrate to OpenAPI v3 ?

  • The new path to the doc will be /v3/api-docs
  • The format will be changed (of course)
  • The host and protocol attibutes are replaced by a servers one. This should be reflected in the JHipsterProperties. (but there seems to be a bug in springfox atm so the servers docket param is not used...)

Note that it's possible to have both Swagger2 and OAIv3 specs generated. So I propose to effectively migrate to v3 but to keep v2 generation for backward compat. Then we can remove v2 support in JHipster v7. WDYT ?

changes api dependencies openapi swagger v7

Most helpful comment

Should we also take the opportunity to rename swagger to openapi everywhere ?

All 6 comments

Since it will be included in v7, it is time for me to switch to OpenAPI v3 by default, and we can keep v2 for backward compatibility of previous application version (depends if it is too much work).
Will update v7 planning to remove migration to springdoc and add OpenAPI v3 migration to reference this ticket.

Great. I also plan to replace the UT we have for springfox autoconfig which are not very useful (not much logic to test, only mocks, etc...) by much more meaningful integration tests.

we can keep v2 for backward compatibility of previous application version

Only if it's not much work and no 'hack'. Otherwise, let's switch to v3 completely !

Not much work and not hacky at all :smiley:

Should we also take the opportunity to rename swagger to openapi everywhere ?

yes agree @cbornet for v7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielFran picture DanielFran  路  3Comments

chegola picture chegola  路  4Comments

SudharakaP picture SudharakaP  路  3Comments

edvjacek picture edvjacek  路  3Comments

tomj0101 picture tomj0101  路  3Comments