Comments (9)
Fixed in 2.0.2
from mapped-types.
https://github.com/Keeper991/partial-type-issue/blob/master/src/app.service.ts
ChildClass inherits ParentClass with PartialType, and tried to push partial object in ChildClass Array(line:16).
but ts throws an error message 'missing the following properties from type 'ChildClass': age, job'.
from mapped-types.
@micalevisk did the example above help ? it show the problem immediately.
from mapped-types.
thanks!
that was a regression introduced by PR #1027 on v2.0.0
from mapped-types.
and that's due to your strictNullChecks
being false
btw
which breaks the following utility:
from mapped-types.
I faced the same problem. There is a problem in that the properties of the instance of the class inherited as a partial type are not guided to optional. 🥲
from mapped-types.
@Keeper991 do you mind on sharing a minimum reproduction repository? it would help us to fix that quickly
from mapped-types.
minimum reproduction repository
(note the repository part)
please don't spam. That doesn't help on fixing the issue. Also, you guys could investigate why that bug exists and try to fix that as well :)
from mapped-types.
why reproductions are required
from mapped-types.
Related Issues (20)
- Class 'CreateUserDto' incorrectly extends base class 'RemoveFieldsWithType<Partial<User>, Function>'. Property 'status' is optional in type 'CreateUserDto' but required in type 'RemoveFieldsWithType<Partial<User>, Function>' HOT 6
- Extending using PartialType, OmitType… doesn't copy properties decorators HOT 3
- PickType ignore parent's @Transform when grandparent use @Transform
- Breaking change in 2.0.3 for override fields HOT 5
- Using a PartialType inside a PickType will result in a type error. HOT 1
- IntersectionType breaks returning value of methods HOT 4
- `PickType` doesn't carry over property level`@Expose` decorators
- Create build using latest code HOT 5
- Mapped Types are not transformed with [email protected]+ in browser HOT 1
- Can't inherit getter/setter and function HOT 2
- PartialType can't work with class-validator HOT 1
- `IntersectionType` clause for more than 4 classes is not available in the npm version HOT 4
- Remove @nestjs/common dependency HOT 2
- Could not resolve dependency: peerOptional class-validator@"^0.11.1 || ^0.12.0 || ^0.13.0" from @nestjs/[email protected] HOT 5
- Support for class-validator 0.14.0 HOT 4
- Install fails when class-validtor 0.14.0 already installed HOT 1
- Update security dependencies HOT 4
- `prettier/@typescript-eslint` in ESLint config now throws error HOT 1
- Update the class-validator dependency to 0.14.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapped-types.