-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Server. Update KDocs for Application.respond...
#5233
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughUpdated KDoc comments and a copyright year in ApplicationResponseFunctions; removed an unused import. No public API or behavior changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Application.respond...
| * @see [io.ktor.server.response.ApplicationResponse] | ||
| * @param contentType is an optional [ContentType], default is [ContentType.Text.Plain] | ||
| * @param status is an optional [HttpStatusCode], default is [HttpStatusCode.OK] | ||
| * @param status is an optional [HttpStatusCode], default is [HttpStatusCode.OK] unless already assigned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with other KDocs, I suggest to omit the verb (is) in this and the next occurrences:
| * @param status is an optional [HttpStatusCode], default is [HttpStatusCode.OK] unless already assigned | |
| * @param status An optional [HttpStatusCode], defaults to [HttpStatusCode.OK] unless already assigned |
| * | ||
| * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.response.respondBytesWriter) | ||
| * | ||
| * @param contentType An optional [ContentType], unspecified by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the default contentType actually ContentType.Application.OctetStream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vnikolova afaik it is used as a default in the Client's defaultTransformers. But on the server, it's chosen depending on the data sent, isn't it? @bjhham
0d58b43 to
1cec757
Compare
Subsystem
Server
Motivation
I was confused that calling
call.respondText()doesn't set the status code to 200 if it was assigned before.Solution
Mentioned this behaviour in KDocs.