Skip to content

Swagger v11 doesn't properly support extended class DTO's wrapped with PartialType() utility function #3333

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

Open
1 of 4 tasks
tauinbox opened this issue Mar 4, 2025 · 2 comments

Comments

@tauinbox
Copy link

tauinbox commented Mar 4, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

It is almost the same as #518 but with a subtle difference
If we wrap up the extended class with the PartialType() function we get the same behavior

Minimum reproduction code

See #518 and make use of PartialType() for the BaseTestDTO

Steps to reproduce

No response

Expected behavior

I expect the result in OutBasicTestDTO to be a mix of the props defined in OutBasicTestDTO as well as BaseTestDTO.

Package version

11.0.3

NestJS version

11.0.7

Node.js version

No response

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@kamilmysliwiec
Copy link
Member

Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project).

@tauinbox
Copy link
Author

tauinbox commented Mar 5, 2025

Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project).

https://codesandbox.io/p/sandbox/optimistic-jones-gv5y2j?file=%2Fsrc%2Fdto%2Fclass-b.dto

The problem here is that in class B there are no properties from class A displayed in the swagger schema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants