Closed Val0429 closed 12 months ago
Duplicated issue: https://github.com/samchon/nestia/issues/600
I hope you to make the router function to have another method like PATCH
, and use @TypedBody()
instead.
The standard URL query allows only Record<string, string | string[] | undefined>
type. I know there're some insane libraries writing JSON string on URL query properties, but it is violating the standard spec. Furthermore, the URL address has length limitation, so such raw JSON string assignment causes unexepcted error that hard to trace and debug.
This is the reason why @TypedQuery()
decorator is not supporting the JSON type, and enforcing restriction following the standard spec. It is on your mind that whether calling JSON.stringify()
and JSON.parse()
functions on a string
typed property of @TypedQuery()
or not, but nestia
doesn't have plan to support such standard violating feature.
Feature Request
I'd like to request an enhancement for
Nestia
that allows for extended queries while using a GET request. This feature would be really helpful in certain situations.For instance, ZenStack provides a helpful format in its CRUD API like this: LINK
With the 'q' parameter, Prisma's
findMany
interface is exposed, which is very flexible and useful.I'm wondering if it's possible to incorporate this kind of parameter parsing into
Nestia
. To explain in more detail, this would involve first usingJSON.parse
on the 'q' parameter's string, and then usingassertEqual
to validate the interface.Thank you.