Skip to content

Commit 473f4e2

Browse files
committed
URL is still not Sendable
1 parent c87129b commit 473f4e2

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

Sources/_OpenAPIGeneratorCore/Layers/RenderedSwiftRepresentation.swift

+4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14+
#if os(Linux)
15+
@preconcurrency import struct Foundation.URL
16+
#else
1417
import struct Foundation.URL
18+
#endif
1519
import struct Foundation.Data
1620

1721
/// An in-memory file that contains the generated Swift code.

Sources/_OpenAPIGeneratorCore/Translator/CommonTypes/Constants.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ enum Constants {
2828
ImportDescription(moduleName: "OpenAPIRuntime", spi: "Generated"),
2929
ImportDescription(
3030
moduleName: "Foundation",
31-
moduleTypes: ["struct Foundation.URL", "struct Foundation.Data", "struct Foundation.Date"]
31+
moduleTypes: ["struct Foundation.Data", "struct Foundation.Date"]
32+
),
33+
ImportDescription(
34+
moduleName: "Foundation",
35+
moduleTypes: ["struct Foundation.URL"],
36+
preconcurrency: .onOS(["Linux"])
3237
),
3338
]
3439

Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0007.md

+4
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,11 @@ Generated using the following command:
321321
// -----------
322322
// Generated by swift-openapi-generator, do not modify.
323323
@_spi(Generated) import OpenAPIRuntime
324+
#if os(Linux)
325+
@preconcurrency import struct Foundation.URL
326+
#else
324327
import struct Foundation.URL
328+
#endif
325329
import struct Foundation.Data
326330
import struct Foundation.Date
327331

Sources/swift-openapi-generator/runGenerator.swift

+4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14+
#if os(Linux)
15+
@preconcurrency import struct Foundation.URL
16+
#else
1417
import struct Foundation.URL
18+
#endif
1519
import struct Foundation.Data
1620
import class Foundation.FileManager
1721
import ArgumentParser

0 commit comments

Comments
 (0)