Support executing an OASFilter during multiple run stages#52669
Support executing an OASFilter during multiple run stages#52669gsmet merged 1 commit intoquarkusio:mainfrom
Conversation
|
/cc @MikeEdgar @HerrDerb |
Status for workflow
|
|
🙈 The PR is closed and the preview is expired. |
Status for workflow
|
MikeEdgar
left a comment
There was a problem hiding this comment.
Thanks for working on this @Postremus . I didn't spot any issues with the changes.
|
@Postremus Thank you very much 👍 |
gsmet
left a comment
There was a problem hiding this comment.
If @MikeEdgar is happy, let’s merge it.
Does it break compatibility or we can backport to 3.32?
|
The changes are designed to be backwards compatible with the behaviour of 3.31. So i would say can be backported to 3.32. |
|
But tbh does not need to be back ported to 3.32. So +0 on backport. We might want to add a few lines for the 3.31 migration guide, explaining the eager Vs first request execution change. Will prepare something later. |
|
I think it’s worth having it in the next LTS so will backport. |
|
@gsmet Smallrye OpenAPI: If you require your OpenApiFilter to run at request time instead of startup time, make sure to configure `quarkus.smallrye-openapi.always-run-filter=true`. Runtime filters were executed on first request, not on startup, meaning that for example the vert.x request context of that first request would be available. On second request, such runtime filters would not be executed again, leading to the OpenAPI document containing stale changes based on the first request. OASFilter annotated as `@OpenApiFilter` (or `@OpenApiFilter(OpenApiFilter.RunStage.RUN)`) now correctly execute eagerly on startup, like the documentation already suggested they were: ``` Runtime filters by default runs on startup (when the final OpenAPI document gets created). ``` (https://quarkus.io/version/3.27/guides/openapi-swaggerui#runtime-filters) |
This provides multiple differentiated RunStages during which an OASFilter can be run.
Fixes #52481