Move to FoundationEssentials (#59)

Uses `FoundationEssentials` instead of `Foundation`. Also removes
`NIOFoundationCompat`, because it did appear to be used, and that pulled
in the entire Foundation.

Also disabled the default traits for the `OpenAPIRuntime` to prevent
linking Foundation.
This commit is contained in:
Mads Odgaard
2026-03-06 18:55:32 +01:00
committed by GitHub
parent 502e303d73
commit 5ee8f2dd51
5 changed files with 75 additions and 10 deletions
@@ -15,15 +15,14 @@ import OpenAPIRuntime
import AsyncHTTPClient
import NIOCore
import NIOHTTP1
import NIOFoundationCompat
import HTTPTypes
#if canImport(Darwin)
import Foundation
#if canImport(FoundationEssentials)
@preconcurrency import struct FoundationEssentials.URL
import struct FoundationEssentials.URLComponents
import struct FoundationEssentials.Data
import protocol FoundationEssentials.LocalizedError
#else
@preconcurrency import struct Foundation.URL
import struct Foundation.URLComponents
import struct Foundation.Data
import protocol Foundation.LocalizedError
import Foundation
#endif
/// A client transport that performs HTTP operations using the HTTPClient type