Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
//===----------------------------------------------------------------------===//
#if os(Linux)
@preconcurrency import struct Foundation.URL
@preconcurrency import struct Foundation.Data
#else
import struct Foundation.URL
import struct Foundation.Data
#endif
import struct Foundation.Data

/// An in-memory file that contains the generated Swift code.
typealias RenderedSwiftRepresentation = InMemoryOutputFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ enum Constants {
ImportDescription(moduleName: "OpenAPIRuntime", spi: "Generated"),
ImportDescription(
moduleName: "Foundation",
moduleTypes: ["struct Foundation.URL", "struct Foundation.Data", "struct Foundation.Date"],
moduleTypes: ["struct Foundation.Data", "struct Foundation.Date"]
),
ImportDescription(
moduleName: "Foundation",
moduleTypes: ["struct Foundation.URL"],
preconcurrency: .onOS(["Linux"])
),
Comment thread
czechboy0 marked this conversation as resolved.
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public enum Operations {

This proposal covers generating the following additional API surface to
simplify providing inputs.

```swift
extension APIProtocol {
// The parameters to each overload will match those of the corresponding
Expand All @@ -202,7 +202,7 @@ extension APIProtocol {
This proposal also covers generating the following additional API surface to
simplify handling outputs.

```swift
```swift
// Note: Generating an extension is not prescriptive; implementations may
// generate these properties within the primary type definition.
extension Operations.getGreeting.Output {
Expand Down Expand Up @@ -323,13 +323,12 @@ Generated using the following command:
@_spi(Generated) import OpenAPIRuntime
#if os(Linux)
@preconcurrency import struct Foundation.URL
@preconcurrency import struct Foundation.Data
@preconcurrency import struct Foundation.Date
#else
import struct Foundation.URL
#endif
import struct Foundation.Data
import struct Foundation.Date
#endif

/// A type that performs HTTP operations defined by the OpenAPI document.
public protocol APIProtocol: Sendable {
/// - Remark: HTTP `GET /greet`.
Expand Down
3 changes: 1 addition & 2 deletions Sources/swift-openapi-generator/runGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
//===----------------------------------------------------------------------===//
#if os(Linux)
@preconcurrency import struct Foundation.URL
@preconcurrency import struct Foundation.Data
#else
import struct Foundation.URL
import struct Foundation.Data
#endif
import struct Foundation.Data
import class Foundation.FileManager
import ArgumentParser
import _OpenAPIGeneratorCore
Expand Down