Skip to content

[Decorator] Model deserialization #3

@Romakita

Description

@Romakita

@BodyParams can deserialize an entire object and restore his methods if the type is provided via ReflectMetadata and Typescript.

Example:

@Controller("/")
export class EventCtrl {

     @Post("/")
     save(@BodyParams() event: Event){
          console.log(event instanceof Event); // true
     } 

     //OR
     @Post("/")
     save(@BodyParams('event') event: Event){}
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions