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
With the CLI plugin not supporting the class-transformer @Expose and @Exclude and @ApiHideProperty() not being composable the developer experience is less than it could be.
Describe the solution you'd like
The optimal - IMO - solution would be to add a class-transformer shim that scans for Expose like the class-validator shim does and extends the array of decorators (currently only ApiHideProperty) used to skip a property to include Exclude. I see this idea has been shutdown multiple times.
The other option would be to add a plugin configuration option hidePropertiesDecoratedWith that is an array of strings that will be ignored when the plugin is processing. The exclusion logic already exists (hidePropertyDecorator) and supports an array of strings. The plugin options are locally available in the method (visitPropertyNodeDeclaration) used to decide if a property is annotated or not.
What is the motivation / use case for changing the behavior?
Using class-transformer for validation and serialization is at the core of NestJS it would be great to improve the DE so the swagger module is intergraded with these core concepts. Also, selfishly I'm sick of seeing @Exclude() and @ApiHideProperty side-by-side or missing @ApiHideProperty and the property being shown in the documentation.
I'm happy to do a PR to support either or both of these changes.
The text was updated successfully, but these errors were encountered:
kurt-west
changed the title
Support @Expse and @Exclude or allow custom @ApiHideProperty() decorators
Support @Expose and @Exclude or allow custom @ApiHideProperty() decorators
Sep 5, 2023
kurt-west
changed the title
Support @Expose and @Exclude or allow custom @ApiHideProperty() decorators
Support @Expose() and @Exclude() or allow custom @ApiHideProperty() decorators
Sep 5, 2023
The optimal - IMO - solution would be to add a class-transformer shim that scans for Expose like the class-validator shim does and extends the array of decorators (currently only ApiHideProperty) used to skip a property to include Exclude. I see this idea has been shutdown multiple times.
The optimal - IMO - solution would be to add a class-transformer shim that scans for Expose like the class-validator shim does and extends the array of decorators (currently only ApiHideProperty) used to skip a property to include Exclude. I see this idea has been shutdown multiple times.
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
With the CLI plugin not supporting the class-transformer
@Expose
and@Exclude
and@ApiHideProperty()
not being composable the developer experience is less than it could be.Describe the solution you'd like
The optimal - IMO - solution would be to add a class-transformer shim that scans for
Expose
like the class-validator shim does and extends the array of decorators (currently onlyApiHideProperty
) used to skip a property to includeExclude
. I see this idea has been shutdown multiple times.The other option would be to add a plugin configuration option
hidePropertiesDecoratedWith
that is an array of strings that will be ignored when the plugin is processing. The exclusion logic already exists (hidePropertyDecorator) and supports an array of strings. The plugin options are locally available in the method (visitPropertyNodeDeclaration) used to decide if a property is annotated or not.Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
Using class-transformer for validation and serialization is at the core of NestJS it would be great to improve the DE so the swagger module is intergraded with these core concepts. Also, selfishly I'm sick of seeing
@Exclude()
and@ApiHideProperty
side-by-side or missing@ApiHideProperty
and the property being shown in the documentation.I'm happy to do a PR to support either or both of these changes.
The text was updated successfully, but these errors were encountered: