apple / swift-openapi-urlsession

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

Fix request and response translation #51

Closed guoye-zhang closed 2 months ago

guoye-zhang commented 3 months ago

Motivation

Fix the translation between Foundation types and HTTP types.

Modifications

The code is mostly borrowed from swift-http-types:

https://github.com/apple/swift-http-types/tree/main/Sources/HTTPTypesFoundation

Translates the string encoding (URLSession expects ISOLatin1) and handles multi-value fields.

Result

Should address the cookie issue among other issues.

Test Plan

All existing tests still pass.

simonjbeaumont commented 3 months ago

Change looks great, thank you @guoye-zhang!

Do you think we can extend the tests to cover the different delimiter appending logic based?

guoye-zhang commented 3 months ago

I updated the test with multiple values. ; joining is already tested by the cookie header.

czechboy0 commented 2 months ago

@swift-server-bot test this please

simonjbeaumont commented 2 months ago

@swift-server-bot add to allowlist

czechboy0 commented 2 months ago

The failed CI is a transitive infra issue, rekicking.

czechboy0 commented 2 months ago

@swift-server-bot test this please