Skip to content

Commit ef2b34c

Browse files
authored
[Bug] Make a missing converter helper public (#54)
[Bug] Make a missing converter helper public ### Motivation In the previous PR, we missed one method which was supposed to be public, but was internal. Discovered while testing the generator, this this isn't being seen by users yet, but blocks us from rolling out the next 0.2.x generator. ### Modifications Removed `@testable` (which made us miss it) from converter tests and made the missing method public. ### Result Generated code should compile again. ### Test Plan This PR is mostly about updating tests to catch this next time. Reviewed by: glbrntt Builds: ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (api breakage) - Build finished. ✔︎ pull request validation (docc test) - Build finished. ✔︎ pull request validation (integration test) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #54
1 parent 9ac0b62 commit ef2b34c

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

Sources/OpenAPIRuntime/Conversion/Converter+Server.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ extension Converter {
274274
}
275275

276276
// | server | get | request body | URLEncodedForm | codable | optional | getOptionalRequestBodyAsURLEncodedForm |
277-
func getOptionalRequestBodyAsURLEncodedForm<T: Decodable, C>(
277+
public func getOptionalRequestBodyAsURLEncodedForm<T: Decodable, C>(
278278
_ type: T.Type,
279279
from data: Data?,
280280
transforming transform: (T) -> C

Tests/OpenAPIRuntimeTests/Conversion/Test_Converter+Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import XCTest
15-
@_spi(Generated)@testable import OpenAPIRuntime
15+
@_spi(Generated) import OpenAPIRuntime
1616

1717
final class Test_ClientConverterExtensions: Test_Runtime {
1818

Tests/OpenAPIRuntimeTests/Conversion/Test_Converter+Common.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import XCTest
15-
@_spi(Generated)@testable import OpenAPIRuntime
15+
@_spi(Generated) import OpenAPIRuntime
1616

1717
final class Test_CommonConverterExtensions: Test_Runtime {
1818

Tests/OpenAPIRuntimeTests/Conversion/Test_Converter+Server.swift

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import XCTest
15-
@_spi(Generated)@testable import OpenAPIRuntime
15+
@_spi(Generated) import OpenAPIRuntime
1616

1717
final class Test_ServerConverterExtensions: Test_Runtime {
1818

@@ -92,26 +92,12 @@ final class Test_ServerConverterExtensions: Test_Runtime {
9292
"Unexpected error when validating string: \(contentType) against headers: \(headers)"
9393
)
9494
} else {
95-
let acceptHeader =
96-
headers
97-
.values(name: "accept")
98-
.joined(separator: ", ")
9995
XCTAssertThrowsError(
10096
try converter.validateAcceptIfPresent(
10197
contentType,
10298
in: headers
10399
),
104-
"Expected to throw error when validating string: \(contentType) against headers: \(headers)",
105-
{ error in
106-
guard
107-
let err = error as? RuntimeError,
108-
case .unexpectedAcceptHeader(let string) = err
109-
else {
110-
XCTFail("Threw an unexpected error: \(error)")
111-
return
112-
}
113-
XCTAssertEqual(string, acceptHeader)
114-
}
100+
"Expected to throw error when validating string: \(contentType) against headers: \(headers)"
115101
)
116102
}
117103
}

0 commit comments

Comments
 (0)