[Kotlin] [#8809] Allow optional header parameters with Kotlin and ret… (#9306)

* [Kotlin] [#8809] Allow optional header parameters with Kotlin and retrofit2

* [Kotlin] [#8809] Update sample client

* [Kotlin] [#8809] Replace mustache dot notation with more classic style

* [Kotlin] [#8809] Remove new line at the end of the mustache template
This commit is contained in:
Stefan Hanselmann
2021-05-20 17:07:04 +02:00
committed by GitHub
parent 1ff436a86a
commit d1b8a3fac4
4 changed files with 4 additions and 4 deletions

View File

@@ -1 +1 @@
{{#isHeaderParam}}@Header("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isHeaderParam}}
{{#isHeaderParam}}@Header("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isHeaderParam}}

View File

@@ -34,7 +34,7 @@ interface PetApi {
* @return [Call]<[Unit]>
*/
@DELETE("pet/{petId}")
fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Call<Unit>
fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String? = null): Call<Unit>
/**
* Finds Pets by status

View File

@@ -35,7 +35,7 @@ interface PetApi {
* @return [Call]<[Unit]>
*/
@DELETE("pet/{petId}")
fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Completable
fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String? = null): Completable
/**
* Finds Pets by status

View File

@@ -34,7 +34,7 @@ interface PetApi {
* @return [Call]<[Unit]>
*/
@DELETE("pet/{petId}")
fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Call<Unit>
fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String? = null): Call<Unit>
/**
* Finds Pets by status