Fixes a bug in #5142 for multi-word parameters (#5185)

In the convenience class defined for generating a Map of query parameters, the
parameter name was mistakenly being set to the Java variable name, not the
actual parameter name. These are often the same, but can be different in the
case of multi-word parameters, such as in the sample API's `enum_query_string`
vs `enumQueryString`.
This commit is contained in:
Benjamin Douglas 2017-03-24 07:04:11 -07:00 committed by wing328
parent ffbb96e98c
commit 65b6660c55
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ public interface {{classname}} extends ApiClient.Api {
public static class {{operationIdCamelCase}}QueryParams extends HashMap<String, Object> {
{{#queryParams}}
public {{operationIdCamelCase}}QueryParams {{paramName}}(final {{{dataType}}} value) {
put("{{paramName}}", value);
put("{{baseName}}", value);
return this;
}
{{/queryParams}}

View File

@ -114,15 +114,15 @@ public interface FakeApi extends ApiClient.Api {
*/
public static class TestEnumParametersQueryParams extends HashMap<String, Object> {
public TestEnumParametersQueryParams enumQueryStringArray(final List<String> value) {
put("enumQueryStringArray", value);
put("enum_query_string_array", value);
return this;
}
public TestEnumParametersQueryParams enumQueryString(final String value) {
put("enumQueryString", value);
put("enum_query_string", value);
return this;
}
public TestEnumParametersQueryParams enumQueryInteger(final Integer value) {
put("enumQueryInteger", value);
put("enum_query_integer", value);
return this;
}
}