This repository has been archived by the owner on Oct 18, 2022. It is now read-only.
Decide what DTO design pattern class-validation is optimizing for #6
Labels
discovery
more information is needed
documentation
Improvements or additions to documentation
package/class-validation
issues related to @kangojs/class-validation
work item
A work item/ticket rather than an issue
In a project using class-validation I'm facing a design pattern decision/question about the use of "DTO" classes.
Right now in that project DTO classes exist and are used to describe & validate request data. The same DTO classes are also used to describe the data passed from controllers -> business logic services -> database services.
The issue is my request data shape is now diverging from the data shape required by the database service. This means I now need multiple "DTO" classes for a single action:
This is fine, but I'm finding it somewhat confuses the use of the phrase "DTOs". My solution so far has been to now have a distinction between "shapes" and "dtos":
None of this really relates to class-validation too much, however I'm thinking that it could be worth while removing all references to "DTOs" from class-validation.
The text was updated successfully, but these errors were encountered: