Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model mapper support #83

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Model mapper support #83

wants to merge 7 commits into from

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