I'm trying to use array value for the url. So I have this as Joi validation.
entity: Joi.array().allow(['person','location','organization']).unique().single().default(['person'])
It works fine if I do this
http://something.com/query?entity=person&person=organization
It sees entity
as an array so when I print out value from request
console.log(request.query.entity) // ['person', 'organization']
However, if I do this
http://something.com/query?entity=person
I get entity
as string instead of ['person']
console.log(request.query.entity) // 'person'
What I want is I want this url http://something.com/query?entity=person
for entity
to be seen as ['person']