Skip to content

Commit

Permalink
docs(rest-crud): update
Browse files Browse the repository at this point in the history
  • Loading branch information
Char2sGu committed Aug 13, 2022
1 parent 61bba02 commit 0697403
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ book instanceof Book; // true
book.name === "name"; // true
```

By default `RestGenericSerializer` requires the entity constructor to take no parameters, because it's impossible to know what argument to pass. An error will be thrown if `entityClass.length !== 0`. But we can customize how new entities are instantiated by overriding its `createEntity()` method where the purified payload will be passed as a parameter:
By default `RestGenericSerializer` use DeepKit deserialization to instantiate new entities. We can customize how new entities are instantiated by overriding its `createEntity()` method where the purified payload will be passed as a parameter:

```ts
class BookSerializer extends RestGenericSerializer<Book> {
Expand Down

0 comments on commit 0697403

Please sign in to comment.