Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Better support for arrays for @Param() decorator #60

Description

@friendly-tech

When you have a param into a controller method that is an array you need to specify the array schema manually.

public async saveBulk(
@Param(yup.array().transform(values => values.map(v => new MyModel(v)))) 
bulkItems: Array<MyModel>): Promise<any> { ... }

but it would be nice if the @Param() decorator could detect the array input type and handle it accordingly, this may well apply to the Validate() decorator as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreCore packagesenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions