Skip to content

Remove no-longer-needed @preconcurrencys #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
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"])
),
]
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