diff --git a/bitrise.yml b/bitrise.yml index 69390c39ae6..b4af0773410 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -48,4 +48,4 @@ workflows: meta: bitrise.io: - stack: osx-xcode-16.0.x + stack: osx-xcode-16.3.x diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index 3f60f35560e..d305f167903 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -140,7 +140,7 @@ private var credentialStore = SynchronizedDictionary() encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache index af45cadbeb5..191545c3d70 100644 --- a/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache @@ -140,7 +140,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 8d45a2bbb69..7525c158b9a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index aa6558b927b..6f10c3cae31 100644 --- a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index d787d429b31..06b39a40120 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ internal class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendab encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)") diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 802e927474b..93bcea293c6 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -140,7 +140,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) } else if contentType.hasPrefix("application/x-www-form-urlencoded") { encoding = FormURLEncoding() - } else if contentType.hasPrefix("application/octet-stream"){ + } else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") { encoding = OctetStreamEncoding() } else { fatalError("Unsupported Media Type - \(contentType)")