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
I use native private properties inside my DB entity to prevent them from being exposed by accident to the users. It is needed because I also use typeorm's lifecycle decorators to run some logic eg. hashing password (and I need to store previous password inside the private property)
The nest's swagger plugin copies a transformed content of entities into _OPENAPI_METADATA_FACTORY static property, but it leaves private properties in their place.
The problem is that the whole app fails to run because private properties are allowed only inside classes but not in object literals.
Is there an existing issue for this?
Current behavior
I use native private properties inside my DB entity to prevent them from being exposed by accident to the users. It is needed because I also use typeorm's lifecycle decorators to run some logic eg. hashing password (and I need to store previous password inside the private property)
The nest's swagger plugin copies a transformed content of entities into
_OPENAPI_METADATA_FACTORY
static property, but it leaves private properties in their place.The problem is that the whole app fails to run because private properties are allowed only inside classes but not in object literals.
Minimum reproduction code
https://github.com/rklos/nestjs-swagger-repro-repo
Steps to reproduce
yarn
yarn build
yarn start:dev
Expected behavior
Private fields should be omitted when creating
_OPENAPI_METADATA_FACTORY
Package version
11.0.5
NestJS version
11.0.9
Node.js version
22.14.0
In which operating systems have you tested?
Other
I cannot use

@ApiHideProperty
because of some Typescript's restrictionsThe text was updated successfully, but these errors were encountered: