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
entitySkipConstructor not working #8444
Labels
Comments
francescosalvi
pushed a commit
to francescosalvi/typeorm
that referenced
this issue
Dec 10, 2021
francescosalvi
pushed a commit
to francescosalvi/typeorm
that referenced
this issue
Dec 10, 2021
7 tasks
francescosalvi
pushed a commit
to francescosalvi/typeorm
that referenced
this issue
Dec 13, 2021
…cover with test Closes typeorm#8444
francescosalvi
pushed a commit
to francescosalvi/typeorm
that referenced
this issue
Dec 14, 2021
…cover with test Closes typeorm#8444
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
entitySkipConstructor
not working as expected/documentedSee #7770, #1772
Expected Behavior
By setting
entitySkipConstructor
connection option, one is able to define an Entity class with strict constructor property initialization, even using object-type destructuring, e.g.:Actual Behavior
Running
migration:run
, or bootstrapping a NestJS app leveraging TypeORM, breaks with:Steps to Reproduce
(see above): simply define an Entity constructor with object destructuring assignment (I actually expect a failure even with strict
undefined
checks of scalar arguments).My Environment
Was reproduced with a MySQL connection, but I believe the error is unrelated to the driver in use.
Are you willing to resolve this issue by submitting a Pull Request?
Root cause / Possible fix
Locally I applied the patch below which seems to have solved the issue. Perhaps this point in code was an oversight? I see in fact than in most if not all instances where
EntityMetadata.create
is invoked,{ fromDeserializer: true }
is passed as well.The text was updated successfully, but these errors were encountered: