Skip to content

Support executing an OASFilter during multiple run stages#52669

Merged
gsmet merged 1 commit intoquarkusio:mainfrom
Postremus:issues/52481-runstage-ext
Feb 21, 2026
Merged

Support executing an OASFilter during multiple run stages#52669
gsmet merged 1 commit intoquarkusio:mainfrom
Postremus:issues/52481-runstage-ext

Conversation

@Postremus
Copy link
Member

This provides multiple differentiated RunStages during which an OASFilter can be run.

Fixes #52481

@Postremus
Copy link
Member Author

/cc @MikeEdgar @HerrDerb

@quarkus-bot
Copy link

quarkus-bot bot commented Feb 18, 2026

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit bede64c.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

🙈 The PR is closed and the preview is expired.

@quarkus-bot
Copy link

quarkus-bot bot commented Feb 18, 2026

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit bede64c.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

Copy link
Contributor

@MikeEdgar MikeEdgar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @Postremus . I didn't spot any issues with the changes.

@HerrDerb
Copy link
Contributor

@Postremus Thank you very much 👍

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If @MikeEdgar is happy, let’s merge it.

Does it break compatibility or we can backport to 3.32?

@gsmet gsmet merged commit 60819b2 into quarkusio:main Feb 21, 2026
41 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.34 - main milestone Feb 21, 2026
@Postremus Postremus deleted the issues/52481-runstage-ext branch February 22, 2026 05:27
@Postremus
Copy link
Member Author

The changes are designed to be backwards compatible with the behaviour of 3.31. So i would say can be backported to 3.32.

@Postremus
Copy link
Member Author

But tbh does not need to be back ported to 3.32.
The users problem with 3.31 was solved by setting the always-run config property.

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.

@gsmet
Copy link
Member

gsmet commented Feb 22, 2026

I think it’s worth having it in the next LTS so will backport.

@Postremus
Copy link
Member Author

Postremus commented Feb 22, 2026

@gsmet
For the 3.31 migration guide:

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change of filter order breaks vertX context use in OSAFilter

4 participants