php-shopify
php-shopify copied to clipboard
Typing Objects returned by the API
All the requests returns an array (which can be a single resource array or an array of multiple resources) if succeeded. When no result is expected (for example a DELETE request), an empty array will be returned.
Why can't we map all objects returned to some typed DTOs ?
@db306 I appreciate your thinking. As far as I remember, I had similar thinking at the beginning. But I cannot remember actually what stopped me from doing that. Maybe the initial step was to create something simple. But after developing the initial version, my priorities changed to other tasks and I couldn't give much more time for this project. (Even I don't have any Shopify app made yet, though the reason for making the SDK was to develop some apps myself). So I think, the main thing here is "time". If you have some time, you are most welcome to fork the repo and work to make it work like that. Remember that, it should be go under a new major version, not under v1.
It would require a lot of mapping work for sure, also those mappings can change from Shopify releases so in order to make this work we would need to change release cycles of this repo. I'll give it a thought, I'm mapping my own objects as I don't need all of them. If other devs are up for a challenge raise your hands.