Ive currently given the below code to get an array of values as query paramters (in Node-express, nodejs v14.17 and OpenAPI version 3.0.1),
- name: abcd
description: abcd
in: query
required: false
schema:
type: array
items:
type: string
but it send the req as an array of values(type is object) only if there are atleast two of them. For a single value, the type is string.How to always get req as array itself?
For example,
if i give a single value say
"Hello",
console.log(typeof(req.query["abcd"]),req.query["abcd"])
O/P: string Hello
but if i give "Hello" and "World",
O/P: object ['Hello','World']
