mobx-rest
mobx-rest copied to clipboard
Model mapper support
Sometime we may need to use different kind of models for view model and request model. That could be vice and versa. Model mapper can handle such mapping automatically.
I'm not sure about the reason for that change. mobx-rest
id built around REST semantics. The problem you are describing falls outside of REST.
For example, if you're using an api takes and returns different kind of models or you are using view model different than api model, you use username for view and name for api request, it could look like this
This is what I don't fully grasp. When using REST, there are no api model
nor view model
. Either the resource has username
or has name
, or both. But read and write are symmetrical.
I would prefer to not support non-REST semantics.
I guess this try to add JSON-API compliance
I guess this try to add JSON-API compliance
It could work that way too.
Apps on field are not always well designed. Sometime for security reasons mainly you may need change your response model to something else. It is indeed made for that case. Also makes view-model and server-model bindings/mappings easier.