Bug Report Checklist
Description
Defining an optional query parameter (configurationRevision in the shown yml) as array, the serialization seems to be wrong, and result in runtime error:
"Cannot read property 'push' of undefined"
Serialized code (api/MeasurementsApi.ts):
if (configurationRevision) {
configurationRevision.forEach((element: any) => {
queryParameters['configurationRevision[]'].push(element);
});
}
It does not work with https://editor.swagger.io/ either, see Issue: swagger-api/swagger-codegen#10280
openapi-generator version
openapi-generator version: 4.3.1
openjdk build: 10.0.2+13
Windows 10
OpenAPI declaration file content or url
swagger: '2.0'
info:
description: Interface of REST Service for the Webclient
version: 2.0.0
title: REST Interface for Webclient
basePath: /api
tags:
- name: configurations
paths:
/measurements:
get:
tags:
- measurements
description: Returns all measurements
parameters:
- name: configurationId
in: query
description: Configuration ID
required: false
type: integer
format: int32
- name: configurationRevision[]
in: query
description: Configuration Revision
required: false
type: array
items:
type: integer
format: int32
collectionFormat: multi
operationId: measurements
produces:
- application/json
responses:
'200':
description: All available measurements
schema:
type: array
items:
type: integer
Command line used for generation
openapi-generator generate -i test.yaml -g typescript-jquery -o out\ts-test\
Steps to reproduce
Suggest a fix
Create an emtpy array, to make push available.
if (configurationRevision) {
queryParameters['configurationRevision[]'] = new Array<number>();
configurationRevision.forEach((element: any) => {
queryParameters['configurationRevision[]'].push(element);
});
}
Bug Report Checklist
Description
Defining an optional query parameter (
configurationRevisionin the shown yml) as array, the serialization seems to be wrong, and result in runtime error:"Cannot read property 'push' of undefined"Serialized code (api/MeasurementsApi.ts):
It does not work with https://editor.swagger.io/ either, see Issue: swagger-api/swagger-codegen#10280
openapi-generator version
openapi-generator version: 4.3.1
openjdk build: 10.0.2+13
Windows 10
OpenAPI declaration file content or url
Command line used for generation
openapi-generator generate -i test.yaml -g typescript-jquery -o out\ts-test\Steps to reproduce
Suggest a fix
Create an emtpy array, to make push available.