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

'validateSuccessfulResponse' shouldn't a part of result<T: DataResponseSerializerProtocol> method #191

Open
bigMOTOR opened this issue Oct 26, 2020 · 0 comments · Fixed by #192
Assignees

Comments

@bigMOTOR
Copy link
Contributor

bigMOTOR commented Oct 26, 2020

validateSuccessfulResponse shouldn't be a part of result<T: DataResponseSerializerProtocol> method. This lefts no room for function composition like runRequest -> validate -> getResult. Current way it fires implicit validation error validate(statusCode: 200..<300) no matter if I have my own function in validate.
I see having validateSuccessfulResponse inside result as a violation of the separation of concern principle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant