Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ][kotlin-spring] Add possibility to turn off Flow usage when reactive=true #16130

Open
hu553in opened this issue Jul 19, 2023 · 6 comments
Open

Comments

@hu553in
Copy link
Contributor

hu553in commented Jul 19, 2023

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

We want to use suspend functions for methods returning single objects, but also we want to use common return types (e.g. List) for methods returning collections.

Our UI can not work with JSON streams at the moment.

On Spring 5 Flow was collected to List internally when Content-Type is application/json, but in Spring 6 this functionality is removed, so we need to return List explicitly.

Describe the solution you'd like

Some option like useFlowForArrayReturnType which will turn on/off using Flow. Possibly it should be considered only if reactive is set to true.

@hu553in hu553in changed the title [REQ][kotlin-spring] Add possibility to turn off Flow usage with reactive=true [REQ][kotlin-spring] Add possibility to turn off Flow usage when reactive=true Jul 19, 2023
@jeferro
Copy link

jeferro commented Dec 6, 2023

+1

1 similar comment
@sekaninovam
Copy link

+1

@wing328
Copy link
Member

wing328 commented Apr 17, 2024

If anyone would like to contribute or sponsor a PR for this enhancement, please reply to let us know. Thank you.

@hu553in
Copy link
Contributor Author

hu553in commented Jan 6, 2025

@wing328 I took it, will try to implement

hu553in added a commit to hu553in/openapi-generator that referenced this issue Jan 7, 2025
hu553in added a commit to hu553in/openapi-generator that referenced this issue Jan 7, 2025
hu553in added a commit to hu553in/openapi-generator that referenced this issue Jan 9, 2025
hu553in added a commit to hu553in/openapi-generator that referenced this issue Jan 9, 2025
wing328 pushed a commit that referenced this issue Jan 11, 2025
…de (#16130) (#20409)

* [kotlin-spring] Adds useFlowForArrayReturnType option for reactive mode (#16130)

* [kotlin-spring] Replaces manual doc change with generated one (#16130)

* [kotlin-spring] Fixes errors (#16130)

* [kotlin-spring] Adds samples (#16130)
@hu553in
Copy link
Contributor Author

hu553in commented Feb 14, 2025

@wing328 hello. Actually I fucked up a bit. The point is that collection endpoints were generated without suspend modified due to their Flow usage and possibility to call suspend methods when building flow. But now, when I added this feature and now can turn off Flow usage, we continue to generate collection endpoints without suspend modifier, and now I can't call any suspend functions from them even if all my backend code is reactive. I think I need to make changes. If reactive=true and my option is turned off, then need to add suspend modifier to collection endpoints as well 🤔

@hu553in
Copy link
Contributor Author

hu553in commented Feb 22, 2025

@wing328 hello, could you check this please? And please check previous comment. Excuse me for this :)

wing328 pushed a commit that referenced this issue Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants