Support to custom response class.#17
Conversation
Add custom response class
Can handle with custom response
Can define a response class
Add test to custom response class
Change to be more clear
Remove pest group
|
This PR looks great, thank you @yurirnascimento. I need to take a proper look at the code on my laptop but thanks for contributing this. |
Sammyjo20
left a comment
There was a problem hiding this comment.
Looks good, I think we should have a connector that can be defined on the response too, which should run the same code as the request. So many could be dedicated to a trait like "HasCustomResponses"
Connector need to implement getResponseClass
Trait for implement getResponseClass
Get default ResponseClass from connector
Use HasResponseClass with implements getResponseClass
Fix Docblock ReflectionException on createResponse
Fix docblock
Change to implement getResponseClass and be used in Connector or Request.
Remove the getResponseClass method implementation to use HasResponseClass trait.
add tests to custom response in connector
Sammyjo20
left a comment
There was a problem hiding this comment.
This looks fantastic! Happy with the code, there's some formatting things I'd like to quickly fix but I'll write a commit for you, but functionality wise this looks great. I will also draft some documentation before the release.
Thanks for the hard work @yurirnascimento and thank you everyone else for helping with the idea.
Sammyjo20
left a comment
There was a problem hiding this comment.
Sorry just a couple other things
Fix small thinks
|
Thanks for this awesome PR @yurirnascimento! Going to write up some documentation now... 💅 |
|
Written up some docs in the “Responses” section. |
|
I just read it and it was great, excellent work. |
|
You too!! 🚀 |
Related to #11
I added the possibility to inform a custom class to return as a response in addition to the default SaloonResponse.
Changes:
Added tests:
I tried to keep the existing coding style.
hope this can help.