Skip to content

documentation: Validating nested arrays after creation with class-transformer #868

Open
@Sauermann

Description

@Sauermann

Description

In the README.md section about validating arrays containing nested objects, the requirements for validating objects created with class-transformer are not made clear. This issue regards the following section of the documentation:

class-validator/README.md

Lines 332 to 342 in 9f0c3e9

It also works with multi-dimensional array, like :
```typescript
import { ValidateNested } from 'class-validator';
export class Plan2D {
@ValidateNested()
matrix: Point[][];
}
```

The problem is, that after creating a nested array with class-transformer with the above code as template, the objects within the array do not contain the class information.

Proposed solution

I suggest to include the following additional information:

When validating nested objects created with class-transformer, it is required to specify the type of the nested objects as described in the class-transformer documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: needs discussionIssues which needs discussion before implementation.type: documentationIssues related to improving the documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions