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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response returns NullBody instead of null for StatusCode 204 and 205 #517

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ph1ll1pp
Copy link
Contributor

@Ph1ll1pp Ph1ll1pp commented Jan 24, 2024

馃 DOD Checklist

Response returns NullBody instead of null for StatusCode 204 and 205.
NullBody is an object from Ktor that was created for exactly such a purpose.
https://api.ktor.io/ktor-http/io.ktor.http.content/-null-body/index.html

It is now possible to use:
@delete("...")
fun test(...): Response< NullBody >

Alternatively, it would be possible to delete the additional check (code == 204 || code == 205) and simply use the standard conversion. Then a Response< Unit > could also be possible. Feedback would be appreciated.

  • I did all relevant changes to the documentation and the changelog.

@Ph1ll1pp Ph1ll1pp requested a review from Foso as a code owner January 24, 2024 17:09
@github-actions github-actions bot added documentation Improvements or additions to documentation ktorfit-lib labels Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ktorfit-lib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant