Skip to content

Commit 3667ef0

Browse files
committed
Initialize optional query parameters with null
1 parent 54394ee commit 3667ef0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{#isQueryParam}}@retrofit2.http.Query("{{baseName}}") {{#collectionFormat}}{{^isCollectionFormatMulti}}@{{{collectionFormat.toUpperCase}}} {{/isCollectionFormatMulti}}{{/collectionFormat}}{{paramName}}: {{{dataType}}}{{/isQueryParam}}
1+
{{#isQueryParam}}@retrofit2.http.Query("{{baseName}}") {{#collectionFormat}}{{^isCollectionFormatMulti}}@{{{collectionFormat.toUpperCase}}} {{/isCollectionFormatMulti}}{{/collectionFormat}}{{paramName}}: {{{dataType}}}{{^required}} = null{{/required}}{{/isQueryParam}}

samples/junit-tests/src/main/java/com/yelp/codegen/generatecodesamples/apis/ResourceApi.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ interface ResourceApi {
116116
)
117117
@GET("/symbols/in/parameter/name")
118118
fun getSymbolsInParameterName(
119-
@retrofit2.http.Query("parameter") parameter: String?,
120-
@retrofit2.http.Query("brackets[]") brackets: String?,
121-
@retrofit2.http.Query("brackets[withText]") bracketsWithText: String?,
122-
@retrofit2.http.Query("dot.") dot: String?,
123-
@retrofit2.http.Query("dot.withText") dotWithText: String?
119+
@retrofit2.http.Query("parameter") parameter: String? = null,
120+
@retrofit2.http.Query("brackets[]") brackets: String? = null,
121+
@retrofit2.http.Query("brackets[withText]") bracketsWithText: String? = null,
122+
@retrofit2.http.Query("dot.") dot: String? = null,
123+
@retrofit2.http.Query("dot.withText") dotWithText: String? = null
124124
): Completable
125125
/**
126126
* The endpoint is owned by junittests service owner

0 commit comments

Comments
 (0)