forked from loafle/openapi-generator-original
* [kotlin][jvm-okhttp4] Fix multipart/form-data with JSON content-type Fixes #16457 Fixes two critical bugs in multipart/form-data handling when parts have Content-Type application/json: 1. IllegalArgumentException: OkHttp throws "Unexpected header: Content-Type" because Content-Type was passed in headers map instead of via asRequestBody(mediaType)/toRequestBody(mediaType) parameter. 2. Invalid JSON serialization: Non-file parts with application/json Content-Type were serialized using toString() instead of proper JSON serialization, producing invalid output like: "MyObject(field1=value, field2=123)" instead of '{"field1":"value","field2":123}' Changes: - Filter Content-Type from headers before passing to OkHttp - Check part Content-Type and use appropriate serializer (JSON vs toString) - Add integration tests with echo server to verify fix - Support all serialization libraries (gson, moshi, jackson, kotlinx) Fixes issues with multipart endpoints that mix file uploads with JSON metadata, common in REST APIs for document/image uploads. * Run mvn clean/package, and regenerate samples * Add fix for kotlinx serialisation issue * Refactor multipart helpers for reified type parameter support * Fix kotlinx.serialization multipart by adding serializer lambda to PartConfig * Fix internal Ktor API usage in multipart forms
org.openapitools.client - Kotlin client library for Demo
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Overview
This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.
- API version: 1.0.0
- Package version:
- Generator version: 7.20.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.KotlinClientCodegen
Requires
- Kotlin 2.2.20
Build
./gradlew check assemble
This runs all tests and packages the library.
Features/Implementation Notes
- Supports JSON inputs/outputs, File inputs, and Form inputs.
- Supports collection formats for query parameters: csv, tsv, ssv, pipes.
- Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
Documentation for API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | idsGet | GET /{ids} |
Documentation for Models
Documentation for Authorization
Endpoints do not require authorization.