Skip to content

fix(kotlin-spring): fix Flow<String> and Flux<T> array return types f…#24101

Draft
Picazsoo wants to merge 1 commit into
OpenAPITools:masterfrom
Picazsoo:bugfix/flow-or-flux-of-string-to-mono-list
Draft

fix(kotlin-spring): fix Flow<String> and Flux<T> array return types f…#24101
Picazsoo wants to merge 1 commit into
OpenAPITools:masterfrom
Picazsoo:bugfix/flow-or-flux-of-string-to-mono-list

Conversation

@Picazsoo

@Picazsoo Picazsoo commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

…or reactive generators

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Fixes reactive array return types in the Kotlin Spring generators to avoid broken decoding and unify API shapes. Arrays of strings now return List<String> with suspend (not Flow<String>), and declarative Reactor interfaces return Mono<List<T>> (not Flux<T>).

  • Bug Fixes

    • Coroutines (kotlin-spring): for array-of-string responses, generate suspend + List<String> to avoid StringDecoder swallowing JSON arrays in Spring WebFlux (issue 22662).
    • Declarative Reactor (spring-declarative-http-interface): array responses now use Mono<{{returnContainer}}<T>> (i.e., Mono<List<T>>), including Mono<ResponseEntity<List<T>>> when enabled; drop reactor.core.publisher.Flux import.
    • Added x-reactive-array-string-return vendor extension and updated templates to conditionally emit the new signatures.
  • Migration

    • Coroutines server: update implementations and callers from Flow<String> to List<String> and mark methods as suspend where applicable.
    • Declarative Reactor: replace Flux<T> returns with Mono<List<T>> (and Mono<ResponseEntity<List<T>>> when used); update imports and tests.

Written for commit 857e8b1. Summary will update on new commits.

Review in cubic

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant