DocteurKiki
DocteurKiki9mo ago

Is there a standard way to create DTO ?

Hi, in classic APIs it is common to transform the records coming from a database into DTO. Is there a standard way to do this in buildship, or should I create a custom node ? Thanks !
2 Replies
Martin
Martin9mo ago
Hi @DocteurKiki, I might be understand you wrong, but a DTO is really just a collection of data points. As such, I wouldn't worry too much about transforming to a DTO. but I would transform to JSON and then use this as a collection for further processes. Does that make sense? HTH, Martin
DocteurKiki
DocteurKikiOP8mo ago
Hi @Martin my question could be generalized to: how to transform an object into another object. (The idea is to return only the data I want instead of all the data from the database in this example). Thanks