Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/OpenAPIRuntime/Conversion/Converter+Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
public import HTTPTypes

extension Converter {
Expand Down
8 changes: 6 additions & 2 deletions Sources/OpenAPIRuntime/Conversion/CurrencyExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
import HTTPTypes

extension ParameterStyle {
Expand Down Expand Up @@ -382,12 +386,12 @@ extension Converter {

guard let queryStart else {
// No existing query substring, add the question mark.
request.path = path.appending("?\(escapedUriSnippet)\(fragment)")
request.path = path + "?\(escapedUriSnippet)\(fragment)"
return
}

let query = pathAndAll[pathAndAll.index(after: queryStart)..<fragmentStart]
request.path = path.appending("?\(query)&\(escapedUriSnippet)\(fragment)")
request.path = path + "?\(query)&\(escapedUriSnippet)\(fragment)"
}

/// Returns the decoded value for the provided name of a query parameter.
Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenAPIRuntime/Conversion/ErrorExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

extension DecodingError {

Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenAPIRuntime/Errors/ClientError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
public import FoundationEssentials
#else
public import Foundation
#endif
public import HTTPTypes

/// An error thrown by a client performing an OpenAPI operation.
Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenAPIRuntime/Errors/ServerError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
public import FoundationEssentials
#else
public import Foundation
#endif
public import HTTPTypes

/// An error thrown by a server handling an OpenAPI operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
public import FoundationEssentials
#else
public import Foundation
#endif

/// A sequence that serializes Server-sent Events.
public struct ServerSentEventsSerializationSequence<Upstream: AsyncSequence & Sendable>: Sendable
Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenAPIRuntime/Interface/CurrencyTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
public import HTTPTypes

/// A container for request metadata already parsed and validated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

/// A generator of a new boundary string used by multipart messages to separate parts.
public protocol MultipartBoundaryGenerator: Sendable {
Expand Down Expand Up @@ -72,6 +76,6 @@ public struct RandomMultipartBoundaryGenerator: MultipartBoundaryGenerator {
public func makeBoundary() -> String {
var randomSuffix = [UInt8](repeating: 0, count: randomNumberSuffixLength)
for i in randomSuffix.startIndex..<randomSuffix.endIndex { randomSuffix[i] = values.randomElement()! }
return boundaryPrefix.appending(String(decoding: randomSuffix, as: UTF8.self))
return boundaryPrefix + String(decoding: randomSuffix, as: UTF8.self)
}
}
Loading