Open DanielCardonaRojas opened 3 years ago
Could be cool to try out a phantom type for Config.
Defer returning data from hijacker to Endpoint decoding closure.
Looks like the previous approach won't work, instead maybe removing map from Endpoint api and reimplement chain in APIClientPublisher.
Suppose we have a model that collects information from 2 different endpoints
This would be done by chaining 2 request something like Endpoint followed by Endpoint<[Description]> and adding the result from the second request to the product.
This can be done by mapping the Endpoint to Endpoint which would go something like this:
As the type of the descriptions endpoint is lost, when intercepting with the clientHijacker which uses the expected response as part of the information to determine if should hijack or not, there is no actual interception occurring.
Ideas
Make Config type more relaxed so that typeString property is options and make it so that in this cases a more complete description of the request is supplied e.g (path and method)