forked from loafle/openapi-generator-original
Support arrays within deepobjects (#11699)
This commit is contained in:
parent
ae86945653
commit
c5213e3b5e
@ -313,7 +313,12 @@ public class {{classname}} {
|
||||
{{#isDeepObject}}
|
||||
if ({{paramName}} != null) {
|
||||
{{#items.vars}}
|
||||
{{#isArray}}
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "{{baseName}}", {{paramName}}.{{getter}}()));
|
||||
{{/isArray}}
|
||||
{{^isArray}}
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}()));
|
||||
{{/isArray}}
|
||||
{{/items.vars}}
|
||||
}
|
||||
{{/isDeepObject}}
|
||||
|
@ -58,6 +58,6 @@ public class JavaClientDeepObjectTest {
|
||||
generator.opts(input).generate();
|
||||
|
||||
assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/DefaultApi.java"),
|
||||
"options[a]", "options[b]");
|
||||
"options[a]", "options[b]", "\"csv\", \"options[c]\"");
|
||||
}
|
||||
}
|
||||
|
@ -34,3 +34,7 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
format: date-time
|
||||
c:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
Loading…
x
Reference in New Issue
Block a user