Closed shefaligoel136 closed 1 year ago
Hello @shefaligoel136, sorry by delay to answer you.
About the first question, in the library all fields informed in the query that are not part of the reserved words for the other types of query params (like limit, skip, page, sort, select, populate) are considered filters. Therefore, I believe that it is kind of complicated to add a DTO for filters, given the dynamics of the fields that can be used as filters. In the future, I intend to implement some advanced features, such as an allowList of filters to be used if you want to use MethodDecorator instead of ParamDecorator. But if you have any specific validation suggestions for any kind of data, please add a pull request, I'll be happy to add new features to the library. :)
On the second question, I haven't used this feature yet, but I can do some tests. I believe you can document the MongoQueryModel object as the @ApiQuery()
parameter if you are using the NestJS recommended library for OpenAPI documentation, but I'm not sure.
hi, any updates about this??
Is it possible to do DTO Validation on filters? and also how to show query in swagger?