-
Notifications
You must be signed in to change notification settings - Fork 13
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
Unify Schema/ResourceObject and Request/ResourceObject to improve developer experience #3
Comments
Hey there, Thank you for your feedback! You are absolutely right that it's not so good that these classes share the same name. But I have to think about how to best solve the problem because there are some constraints:
So I'm not convinced at all that these classes should be merged together... But let's think a little bit:
I am curious about your opinion about what I've just written. |
No, thank you for your hard work!
I think that would work nicely. We've currently switched from our in-house JSONAPI client to yours and we used an approach similar to this. It helps streamlining developer experience when you don't need to be constantly converting back and forth. |
Sorry for being so late! I'll try to come up with a solution, but the Summer is a bit hectic for me :P 😎 |
I started to experiment here with the last solution I proposed: #6 It's not ready yet, because I still have to work on the relationships (they also need two interfaces). |
Just implementing some stuff using this library 👍
One thing I've found rather confusing is having one ResourceObject entity for received resources and a different ResourceObject entity for when we need to create/update. Not only it was unexpected, it's cumbersome to use (class imports, converting one type into another) and very prone to error.
Also, the Request/ResourceObject entity is write-only, and the Schema/ResourceObject entity is read-only. This severely limits what can be done with the entities.
Use cases this separation gets in the way of include:
These two should really be the same entity, I can't quite see any reason they should be different things entirely since they're virtually the same thing, and indeed on JSONAPI they're the same thing.
The text was updated successfully, but these errors were encountered: