Skip to content

Allow request bodies on DELETE in the Kotlin client (multiplatform and jvm-ktor)#23754

Merged
wing328 merged 2 commits into
OpenAPITools:masterfrom
walterbrebels:kotlin-multiplatform-delete-body
May 11, 2026
Merged

Allow request bodies on DELETE in the Kotlin client (multiplatform and jvm-ktor)#23754
wing328 merged 2 commits into
OpenAPITools:masterfrom
walterbrebels:kotlin-multiplatform-delete-body

Conversation

@walterbrebels
Copy link
Copy Markdown
Contributor

@walterbrebels walterbrebels commented May 11, 2026

Add RequestMethod.DELETE to the bodied-methods list in the Kotlin client
multiplatform and jvm-ktor ApiClient.kt.mustache templates.

Motivation

RFC 9110 §9.3.5 permits a payload on DELETE. Several real-world APIs
require 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 requestBody on a DELETE operation cannot be
sent. The fix mirrors the existing PUT/POST/PATCH handling.

Scope

  • kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache
  • kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache

Samples regenerated for all affected configs.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work.
  • Built with ./mvnw clean package and ran ./bin/generate-samples.sh
    for all kotlin-multiplatform/jvm-ktor configs;
    ./bin/utils/export_docs_generators.sh produced no diff.
    Note: bin/configs/unmaintained/kotlin-multiplatform.yaml fails
    independently (pre-existing dateLibrary config bug), so the
    corresponding sample under samples/openapi3/.../kotlin-multiplatform
    was not regenerated.
  • Targeted at master.
  • No linked issue.
  • Kotlin technical committee: @wing328 @jimschubert @cbornet @bjoernblomqvist @4brunu @yutaka0m

Summary by cubic

Allow request bodies on DELETE in the Kotlin client multiplatform and jvm-ktor templates so generated clients no longer drop requestBody for DELETE operations, aligning with RFC 9110.

  • Bug Fixes
    • Treat DELETE as a bodied method in ApiClient.kt.mustache for multiplatform and jvm-ktor (mirrors PUT/POST/PATCH handling).
    • Regenerated affected Kotlin samples to reflect the change.

Written for commit 138dd1a. Summary will update on new commits.

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.
@wing328 wing328 added this to the 7.23.0 milestone May 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

@walterbrebels
Copy link
Copy Markdown
Contributor Author

/rerun-failed

@wing328 wing328 merged commit 7a14a43 into OpenAPITools:master May 11, 2026
118 of 120 checks passed
@wing328
Copy link
Copy Markdown
Member

wing328 commented May 11, 2026

thanks for the fix, which has been merged

@wing328 wing328 changed the title Kotlin multiplatform delete body Allow request bodies on DELETE in the Kotlin client multiplatform and jvm-ktor May 11, 2026
@wing328 wing328 changed the title Allow request bodies on DELETE in the Kotlin client multiplatform and jvm-ktor Allow request bodies on DELETE in the Kotlin client (multiplatform and jvm-ktor) May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants