fix(flows): fix OpenAPI spec generation for FlowController endpoints#15482
Merged
nkwiatkowski merged 3 commits intodevelopfrom Apr 21, 2026
Merged
fix(flows): fix OpenAPI spec generation for FlowController endpoints#15482nkwiatkowski merged 3 commits intodevelopfrom
nkwiatkowski merged 3 commits intodevelopfrom
Conversation
Contributor
🐋 Docker imagedocker run --pull=always --rm -it -p 8080:8080 --user=root -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp ghcr.io/kestra-io/kestra-pr:15482 server local🧪 Java Unit Tests
|
5578165 to
92f4dc8
Compare
Contributor
Tests report quick summary:success ✅ > tests: 5198, success: 5175, skipped: 22, failed: 1 unfold for details
Develocity build scan: https://develocity.kestra.io/s/uow56k3irxbbk |
loicmathieu
approved these changes
Apr 10, 2026
Member
loicmathieu
left a comment
There was a problem hiding this comment.
The fix is a bit disapointing but if there are no other way around, let's do that.
Did you check autocompletion? It may no longuer work for retry which would not be very convenient.
d0ce4e2 to
4c57b50
Compare
87f6651 to
bac8151
Compare
The Micronaut OpenAPI annotation processor was silently skipping all
FlowController endpoints mapped to `{namespace}/{id}` (GET, PUT, DELETE)
because processing `FlowWithSource` → `Flow`/`Task` → `AbstractRetry`
triggered a `PostponeToNextRoundException` on the concrete retry subtypes
(Constant, Exponential, Random). This exception occurs because the Micronaut
constraint validators on those subtypes are processed in the same annotation
processing round, making their metadata unavailable when the OpenAPI processor
tries to introspect them.
Fix: annotate the `retry` field in both `Flow` and `Task` with
`@Schema(implementation = Object.class)` to prevent the processor from
following the `@JsonSubTypes` chain on `AbstractRetry`. Also add class-level
`@Schema` documentation to the concrete retry subtypes.
…orkaround The @Schema(implementation = Object.class) on Task/Flow retry fields fixes the Micronaut OpenAPI processor crash but also caused Swagger2Module to override the field type at runtime, hiding retry subtypes from plugin schemas. Override Swagger2Module.resolveTargetTypeOverrides() to skip the Object.class override only for AbstractRetry fields. Replace custom @constraint validators on retry subtypes with @AssertTrue methods to eliminate the Micronaut bean references that caused the processor crash.
d4a8fee to
a90f36d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FlowControllerendpoints mapped to{namespace}/{id}(GET, PUT, DELETE), generating an empty path{}inopenapi.ymlFlowWithSource→Flow/Task→AbstractRetry→ concrete subtypes (Constant,Exponential,Random) triggered aPostponeToNextRoundExceptionbecause Micronaut constraint validators on those subtypes are processed in the same annotation processing round, making their metadata unavailable to the OpenAPI processorretryfield in bothFlowandTaskwith@Schema(implementation = Object.class)to prevent the processor from following the@JsonSubTypeschain onAbstractRetry; add class-level@Schemadocumentation to the concrete retry subtypesTest plan
./gradlew generateOpenapiSpec --rerun-tasksand verify noPostponeToNextRoundExceptionwarning in the output/api/v1/{tenant}/flows/{namespace}/{id}inopenapi.ymlcontainsget,put, anddeleteoperations (was previously{})./gradlew :webserver:test