mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 17:00:43 +00:00
[kotlin] Fix optional header params in openhttp client (#7341)
This commit adjusts the kotlin openhttp api template to ignore null headers when building the request rather than convert them to "null" string
This commit is contained in:
@@ -88,7 +88,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mutableMapOf()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("api_key" to apiKey.toString())
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
apiKey?.apply { localVariableHeaders["api_key"] = this.toString() }
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.DELETE,
|
||||
"/pet/{petId}".replace("{"+"petId"+"}", "$petId"),
|
||||
|
||||
Reference in New Issue
Block a user