[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:
Ella
2020-09-17 04:09:38 +02:00
committed by GitHub
parent 32c591d9a7
commit bb00d88283
12 changed files with 26 additions and 12 deletions

View File

@@ -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"),