samchon / nestia

NestJS Helper Libraries + TypeScript OpenAPI generator
https://nestia.io/
MIT License
1.76k stars 91 forks source link

Can transform Atomic value to array? #831

Closed sacru2red closed 5 months ago

sacru2red commented 5 months ago

Question

When using TypedQuery, I want to get some array values.

It works in other cases , but not element is atomic so, I want to transform atomic to array

/**
 * @TypedQuery() query: { someArrayExceped: number[] }
*/
// It works { someArrayExpected: [1, 2] } 
https://domain.com/foo-controller/bar-route?someArrayExpected=1&someArrayExpected=2
// but got { someArrayExpected: 1 }, I want to get { someArrayExpected: [1] }
https://domain.com/foo-controller/bar-route?someArrayExpected=1
samchon commented 5 months ago

As @nestia/core calls the URLSearchParams.getAll() method for the array type, your problem can't be.

Here is the example project that demonstrating there's not any problem on the @TypedQuery().

https://stackblitz.com/edit/stackblitz-starters-nkmslk?file=src%2Findex.ts

sacru2red commented 5 months ago

어.. 이상하네요. 분명히 문제가 있었다고 생각했는데... 이제 재현이 안되는군요.

확인해주셔서 감사합니다! 이슈는 닫겠습니다.