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
2 changes: 1 addition & 1 deletion Sources/OpenAPIRuntime/Conversion/Converter+Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ extension Converter {
}

// | server | get | request body | URLEncodedForm | codable | optional | getOptionalRequestBodyAsURLEncodedForm |
func getOptionalRequestBodyAsURLEncodedForm<T: Decodable, C>(
public func getOptionalRequestBodyAsURLEncodedForm<T: Decodable, C>(
_ type: T.Type,
from data: Data?,
transforming transform: (T) -> C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import XCTest
@_spi(Generated)@testable import OpenAPIRuntime
@_spi(Generated) import OpenAPIRuntime

final class Test_ClientConverterExtensions: Test_Runtime {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import XCTest
@_spi(Generated)@testable import OpenAPIRuntime
@_spi(Generated) import OpenAPIRuntime

final class Test_CommonConverterExtensions: Test_Runtime {

Expand Down
18 changes: 2 additions & 16 deletions Tests/OpenAPIRuntimeTests/Conversion/Test_Converter+Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import XCTest
@_spi(Generated)@testable import OpenAPIRuntime
@_spi(Generated) import OpenAPIRuntime

final class Test_ServerConverterExtensions: Test_Runtime {

Expand Down Expand Up @@ -92,26 +92,12 @@ final class Test_ServerConverterExtensions: Test_Runtime {
"Unexpected error when validating string: \(contentType) against headers: \(headers)"
)
} else {
let acceptHeader =
headers
.values(name: "accept")
.joined(separator: ", ")
XCTAssertThrowsError(
try converter.validateAcceptIfPresent(
contentType,
in: headers
),
"Expected to throw error when validating string: \(contentType) against headers: \(headers)",
{ error in
guard
let err = error as? RuntimeError,
case .unexpectedAcceptHeader(let string) = err
else {
XCTFail("Threw an unexpected error: \(error)")
return
}
XCTAssertEqual(string, acceptHeader)
}
"Expected to throw error when validating string: \(contentType) against headers: \(headers)"
)
}
}
Expand Down