-
Notifications
You must be signed in to change notification settings - Fork 6
[FEATURE] Implement Mediator types #3
Comments
I agree this is needed. I haven't figured out a way to solve this generically yet. I struggle to find a way to do it generically in |
My solution requires no changes to existing code, because by default nothing changes. By default the What do you have in mind? Somehow the developer has to tell the system, which properties to decode, no? |
Yeah you're right. Currently in Swift there is probably no other way. If there was a way to iterate over the properties of a struct that implements a protocol it would be possible to do generically, but that's not something that can be done in Swift. |
We will archive Corvus in favor of Apodini as a worthy successor. |
Problem
It may not be desirable to always use
CorvusModel
for decoding the body of certain requests, like create or update requests.Solution
To have more control over what the user is able to provide in a request body 'mediator', or 'carrier' types can be used.
These types are also refered to as 'Data Transfer Objects' or DTOs.
These can be implemented as DTOModifiers and ResponseModifier.
Alternative Solutions
Altering Create and Update endpoint to support these operations.
Altering CorvusModel to inherit this functionality.
The text was updated successfully, but these errors were encountered: