You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an existing issue that is already proposing this?
I have searched the existing issues
Is your feature request related to a problem? Please describe it
This is a possible made up example, but there were many other times I could use the ability to get the JSON schema from an already annotated DTO object.
Specifying the type of AnotherObjectDto | false cannot be done to my knowledge easily without writing the JSON schema manually including the contents of AnotherObjectDto :
exportclassSomeObjectDto{
@ApiProperty()value1!: number|string;
@ApiProperty()value2!: number|string;
@ApiPropertyOptional(/* THE UNION TYPE */)value3?: AnotherObjectDto|false;}classAnotherObjectDto{
@ApiProperty()value1!: number|string;
@ApiProperty()value2!: number|string;}
Having an exported function for getting JSON schema we could do
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
This is a possible made up example, but there were many other times I could use the ability to get the JSON schema from an already annotated DTO object.
Specifying the type of
AnotherObjectDto | false
cannot be done to my knowledge easily without writing the JSON schema manually including the contents ofAnotherObjectDto
:Having an exported function for getting JSON schema we could do
Describe the solution you'd like
Workaround is importing parts from @nestjs/swagger and using:
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
Being able to use the JSON schema of the decorated object either in custom types in
@ApiProperty
decorator or elsewhere.The text was updated successfully, but these errors were encountered: