DTOs and API versioning #712
Unanswered
stackkraft
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Let me start off by saying that this example of the Clean Architecture is great. I have a question though when it comes to applying versioning to the example. If I look at the controllers now, they are directly using the Command classes as their input (c.q. requests). However, I'm not sure if this is the right way when versioning comes into play. Even without versioning one can argue that it would perhaps be better to put DTO classes in between. These DTO classes are then the inputs/requests for the controllers, and these DTO instances are then being mapped to the Command classes to serve as input for the Handler classes. This also allows for versioning, as different versions of the DTOs can coexist, which can be mapped specifically per version to the Command classes.
Does this make sense? And would it be an idea to add this to the example code? (As it is such a great example and I'd recommend everyone to use it).
Thanks,
Mathieu
Beta Was this translation helpful? Give feedback.
All reactions