Skip to content

Conversation

@emrahtoy
Copy link

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.

@masylum
Copy link
Owner

masylum commented Oct 14, 2019

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.

@auvipy
Copy link

auvipy commented Dec 9, 2019

I guess this try to add JSON-API compliance

@emrahtoy
Copy link
Author

emrahtoy commented Dec 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants