springdoc-openapi icon indicating copy to clipboard operation
springdoc-openapi copied to clipboard

Add @Odered to event listener in SpringDocAppInitializer

Open WeisSebastian opened this issue 1 month ago • 2 comments

Is your feature request related to a problem? Please describe.

The EventListener in SpringDocAppInitializer added with 2.8.14, which i appreciate because it highlights a potential issue for us, is causing some problems for us. In our application we have a listener on ApplicationReadyEvent that shuts the application down. This is used in our installation process to start the application, let database migration scripts run and then shut it down again when they are finished. However this seems to consistently happen before the EventListener introduced in 2.8.14 is called, causing an IllegalStateException because the context is already closed. I propose adding @Ordered to your EventListener to allow consumers of the library to better control when the newly introduced event listener is called

Describe the solution you'd like

Add @Ordered to the EventListener in SpringDocAppInitializer

WeisSebastian avatar Nov 19 '25 13:11 WeisSebastian

@WeisSebastian,

Can you please propose a PR for it ?

bnasslahsen avatar Nov 19 '25 17:11 bnasslahsen

Opened #3153

WeisSebastian avatar Nov 20 '25 09:11 WeisSebastian