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

Improve retrieveAll() #310

Merged
merged 16 commits into from
Mar 1, 2022
Merged

Improve retrieveAll() #310

merged 16 commits into from
Mar 1, 2022

Conversation

Art4
Copy link
Collaborator

@Art4 Art4 commented Feb 25, 2022

Hey 👋

The method Redmine\Client\AbstractApi::retrieveData() returns many elements of an endpoint as an array. During the conversion of the response, errors may occur under certain circumstances. In this case the method would return false, or throw an Throwable.

To better guarantee that only an array is returned (and not false) I created a new method retrieveData(). In case of errors in the response a new SerializerException is thrown.

The method retrieveAll() also uses 3 new internal serializers, in which I have outsourced the logic for decoding and encoding XML, JSON and URL paths. I am already working on a next PR where these serializers will be used to bundle the serialization of request/response bodies for XML and JSON. This will be a next step to be able to dynamically switch the format in the request/response between XML and JSON, see #146.

@Art4 Art4 requested a review from kbsali February 26, 2022 11:35
Copy link
Owner

@kbsali kbsali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱 Wow, that's a lot of Great work! aweome! :) 👍

@Art4 Art4 merged commit 458b59b into kbsali:v2.x Mar 1, 2022
@Art4 Art4 deleted the improve-retrieve-all branch March 14, 2022 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants