-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong swagger generation for @Query with array of objects #2945
Comments
Would you like to create a PR for this issue? |
I can confirm, same issue here. |
Can confirm this issue too, experimenting a little I found out that basically the api generator is flattening too much: I forked OP repro to show it ( https://codesandbox.io/p/github/wonderbeel/nest-swagger-query-object-param-issue/ and https://github.com/wonderbeel/nest-swagger-query-object-param-issue ), as you can see we are basically missing one level of nesting. |
Have you resolved the issue yet? I am currently using Apidog to generate API documentation, and it's working well for me. |
I have a FilterDto like so
and an Query param like so
This doesn't generate it right unless i put the FilterDto in an array I tried any news about this? |
I have same issue. |
I am facing the same issue with array of objects |
Is there an existing issue for this?
Current behavior
I want to create a GET endpoint with a inner object inside query params:
The swagger definition is bugged, having all parameters from
QueryParamsSubObject
insideQueryParams
instead ofQueryParams.subObject
:The definition is generated correctly when using
@ApiQuery
instead of@Query
:Minimum reproduction code
Codesandbox
https://github.com/wilker7ribeiro/nest-swagger-query-object-param-issue
Steps to reproduce
npm install
npm start
http://localhost:3000/api
Expected behavior
@Query
should correctly generate the swagger definition as@ApiQuery
does.Package version
7.3.1
NestJS version
10.3.2
Node.js version
10.3.2
In which operating systems have you tested?
The text was updated successfully, but these errors were encountered: