Closed IanKeen closed 3 weeks ago
Hi @IanKeen, have you seen the two logging-middleware-* examples here? https://github.com/apple/swift-openapi-generator/tree/main/Examples
@IanKeen The examples @czechboy0 links so show how you can log the body, which is an AsyncSequence
, so requires you to map over it and produce a new sequence.
Please let us know if that works for you.
@czechboy0 / @simonjbeaumont thank ya'll!
I hadn't see those examples, I got it up and running. I appreciate the help 🙌
Question
Has anyone successfully found a way to log the request/response from the generated client code? It appears as though
ClientMiddleware
only allows a hook into requests not responses. I also attempted to create a customClientTransport
but logging theHTTPBody
causes everything to fail as you can only iterate the bytes once (a second pass throws an error)