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}}
|
{{#isDeepObject}}
|
||||||
if ({{paramName}} != null) {
|
if ({{paramName}} != null) {
|
||||||
{{#items.vars}}
|
{{#items.vars}}
|
||||||
|
{{#isArray}}
|
||||||
|
localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "{{baseName}}", {{paramName}}.{{getter}}()));
|
||||||
|
{{/isArray}}
|
||||||
|
{{^isArray}}
|
||||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}()));
|
localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}()));
|
||||||
|
{{/isArray}}
|
||||||
{{/items.vars}}
|
{{/items.vars}}
|
||||||
}
|
}
|
||||||
{{/isDeepObject}}
|
{{/isDeepObject}}
|
||||||
|
@ -58,6 +58,6 @@ public class JavaClientDeepObjectTest {
|
|||||||
generator.opts(input).generate();
|
generator.opts(input).generate();
|
||||||
|
|
||||||
assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/DefaultApi.java"),
|
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
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
format: date-time
|
format: date-time
|
||||||
|
c:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user