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.
validateSuccessfulResponseshouldn't be a part ofresult<T: DataResponseSerializerProtocol>method. This lefts no room for function composition likerunRequest -> validate -> getResult. Current way it fires implicit validation errorvalidate(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.