Closed sliemeobn closed 1 year ago
Thanks for filing, yes that looks like a bug.
I tried to reproduce in a unit test, but seems to be behaving correctly: https://github.com/apple/swift-openapi-runtime/pull/49
Possibly this could be caused by the client using 0.2 and server 0.1? I could see that leaving the client as escaped, but not being unescaped on the server.
found it, it is actually a bug in the URLSessionTransport's initializer of URLRequest
The URLComponents.url adds another round of percent encoding, basically sending an double-encoded path parameter to the server.
Ok both the URLSession and AHC transports have been released with this fix in 0.2.2.
Thank you @sliemeobn for doing the heavy lifting on this one! 🙏
When using String path parameters, the generated client (correctly) URL-encodes the values to be included in the path. However, the server handler just passes the the "raw" string value in the
input.path
structure.Eg: using the generated client:
server code
I would expect this to be symmetric and arrive decoded in the handler.