You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the flow from http request goes like: JSON -> DTO -> Document -> Document -> DTO -> JSON
A suggestion would be to go JSON -> Document -> Json, Skipp the DTO.
The proposal then is to have a .validate(document) on a dto-like struct, this will make is possible to go [DTO]::validate(document).
This validate method can be generated using a Macro, this macro cleans and makes sure the fields in the document is correct.
Downside: the document struct is a mongodb struct, making is less clean than breaking it out.
Upside: Performance will increase.
The text was updated successfully, but these errors were encountered:
the flow from http request goes like: JSON -> DTO -> Document -> Document -> DTO -> JSON
A suggestion would be to go JSON -> Document -> Json, Skipp the DTO.
The proposal then is to have a .validate(document) on a dto-like struct, this will make is possible to go [DTO]::validate(document).
This validate method can be generated using a Macro, this macro cleans and makes sure the fields in the document is correct.
Downside: the document struct is a mongodb struct, making is less clean than breaking it out.
Upside: Performance will increase.
The text was updated successfully, but these errors were encountered: