Suppose we have a model that collects information from 2 different endpoints
struct Products {
let title: String
var descriptions: [Description]?
}
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:
descriptionsEndpoint.map { descriptions in
var product = fetchedProduct // Captured from context
product.descriptions = descriptions
return product
}
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)