Skip to content

Commit f3c32cc

Browse files
authored
Add missing imports to fix Swift 6.1+ (#709)
### Motivation Currently unit tests on Swift 6.1+ toolchains are failing due to a few missing imports. That these are coming up is good, that's why we've enabled `MemberImportVisibility`. ### Modifications Add the missing imports to stop relying on implicitly imported extension methods. ### Result Unit tests compile again on Swift 6.1+. ### Test Plan Tested locally, will further verify CI is happy.
1 parent 6593b1b commit f3c32cc

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

.github/workflows/pull_request.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
2222
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
2323
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
24-
linux_nightly_main_enabled: false
24+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
2525

2626
integration-test:
2727
name: Integration test

Sources/_OpenAPIGeneratorCore/Extensions/SwiftStandardLibrary.swift

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14+
import Foundation
15+
1416
extension Int {
1517
/// Returns the digits for the number using the specified radix.
1618
/// - Parameter radix: The radix used to format the integer.

Sources/_OpenAPIGeneratorCore/Translator/CommonTypes/StructBlueprint.swift

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import OpenAPIKit
15+
import Foundation
1516

1617
/// A structure that contains the information about an OpenAPI object that is
1718
/// required to generate a matching Swift structure.

Sources/_OpenAPIGeneratorCore/Translator/Content/ContentInspector.swift

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import OpenAPIKit
15+
import Foundation
1516

1617
/// Utilities for asking questions about OpenAPI.Content
1718
extension FileTranslator {

Sources/_OpenAPIGeneratorCore/Translator/TypesTranslator/translateServersVariables.swift

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import OpenAPIKit
15+
import Foundation
1516

1617
/// Represents a server variable and the function of generation that should be applied.
1718
protocol ServerVariableGenerator {

0 commit comments

Comments
 (0)