apple / swift-openapi-urlsession

URLSession transport for Swift OpenAPI Generator.
https://swiftpackageindex.com/apple/swift-openapi-urlsession/documentation
Apache License 2.0
159 stars 31 forks source link

Fix double encoding of path parameters #14

Closed czechboy0 closed 1 year ago

czechboy0 commented 1 year ago

Motivation

Fixes https://github.com/apple/swift-openapi-generator/issues/251.

Modifications

Use the already escaped path setter on URLComponents to avoid the second encoding pass.

Result

Path parameters that needed escaping are only escaped once, not twice.

Test Plan

Adapted the existing unit test to cover a path item that needs escaping.