Is your feature request related to a problem? Please describe.
Using OpenApi-Spec Query-Config as 'type: array, style: form, explode: true' I dont always receive the correct form.
If I call via:
- BAD |
sort=name:asc => transformed to string
- FINE |
sort=name:asc&sort=name:desc => transformed to string[]
- FINE |
<empty> => undefined
Describe the solution you'd like
I would like to have the generator apply the nestjs available Pipe to transform to Arrays:
https://docs.nestjs.com/pipes
PS. Going by the Imports in Controllers only 3 out of 9 Pipe are being implemented - missing ones are ParseBoolPipe, ParseArrayPipe, ParseUUIDPipe, ParseEnumPipe, ParseFilePipe, ParseDatePipe
It appears the missing Pipe should be inside:
- paramPipe.mustache
- controller.mustache
Describe alternatives you've considered
- Adding the missing Pipes by hand - until the next auto-generation is being done
- Make the Frontend always duplicate fields at least once - to enforce an Array being turned in
- Moving the Transformation into some sort of Interceptor / Middleware
Additional context
There might be more Config / Setting to consider on the ParseArrayPipe - like for transforming the items properly or other setting.
Is your feature request related to a problem? Please describe.
Using OpenApi-Spec Query-Config as 'type: array, style: form, explode: true' I dont always receive the correct form.
If I call via:
sort=name:asc=> transformed to stringsort=name:asc&sort=name:desc=> transformed to string[]<empty>=> undefinedDescribe the solution you'd like
I would like to have the generator apply the nestjs available Pipe to transform to Arrays:
https://docs.nestjs.com/pipes
PS. Going by the Imports in Controllers only 3 out of 9 Pipe are being implemented - missing ones are ParseBoolPipe, ParseArrayPipe, ParseUUIDPipe, ParseEnumPipe, ParseFilePipe, ParseDatePipe
It appears the missing Pipe should be inside:
Describe alternatives you've considered
Additional context
There might be more Config / Setting to consider on the ParseArrayPipe - like for transforming the items properly or other setting.