I'm trying to configure a transformer for an endpoint with parameters.
I successfully configured transformers for endpoints that don't include any parameters. But it seems that when I try to do the same for Resource with parameters it won't work.
This is how I configure transformer:
var getExampleData: Resource { return resource(exampleDataEndpoint) }
configureTransformer(getExampleData) {
try jsonDecoder.decode(ExampleDataResponse.self, from: $0.content)
}
And this is how I send the request:
Api.getExampleData.withParam("foo", "bar").addObserver(self).loadIfNeeded()
I get the response but it never goes thru the transformer pipeline.
Response: 200 ← GET http:example.com/enpoint?foo=bar
Siesta:pipeline │ [thread ᎠᏔᎼᎼ] └╴Response after pipeline: success: 28 bytes
EDIT
Tested the .withParam()
method on transforms that work fine and it seems like the URL has to be the same in order to Siesta transformers work, it's a bummer.