Allow request bodies on DELETE in the Kotlin client (multiplatform and jvm-ktor)#23754
Merged
wing328 merged 2 commits intoMay 11, 2026
Merged
Conversation
Allow request body on DELETE in kotlin-client multiplatform and jvm-ktor templates. RFC 9110 permits DELETE bodies; some APIs require them (e.g. bulk-delete payloads). Mirrors the existing PUT/POST/PATCH handling.
Contributor
Author
|
/rerun-failed |
Member
|
thanks for the fix, which has been merged |
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.
Add
RequestMethod.DELETEto the bodied-methods list in the Kotlin clientmultiplatformandjvm-ktorApiClient.kt.mustachetemplates.Motivation
RFC 9110 §9.3.5 permits a payload on
DELETE. Several real-world APIsrequire a body on DELETE (e.g. bulk-delete payloads, soft-delete options).
With the current templates, the generated client silently drops the body
on DELETE, so spec-defined
requestBodyon a DELETE operation cannot besent. The fix mirrors the existing
PUT/POST/PATCHhandling.Scope
kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustachekotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustacheSamples regenerated for all affected configs.
PR checklist
./mvnw clean packageand ran./bin/generate-samples.shfor all kotlin-multiplatform/jvm-ktor configs;
./bin/utils/export_docs_generators.shproduced no diff.Note:
bin/configs/unmaintained/kotlin-multiplatform.yamlfailsindependently (pre-existing
dateLibraryconfig bug), so thecorresponding sample under
samples/openapi3/.../kotlin-multiplatformwas not regenerated.
master.Summary by cubic
Allow request bodies on DELETE in the Kotlin client
multiplatformandjvm-ktortemplates so generated clients no longer droprequestBodyfor DELETE operations, aligning with RFC 9110.DELETEas a bodied method inApiClient.kt.mustacheformultiplatformandjvm-ktor(mirrors PUT/POST/PATCH handling).Written for commit 138dd1a. Summary will update on new commits.