Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
//
//===----------------------------------------------------------------------===//

import HTTPTypes

/// A payload value used by undocumented operation responses.
///
/// Each operation's `Output` enum type needs to exhaustively
Expand All @@ -20,6 +22,19 @@
/// `undocumented` enum case is used when such a status code is
/// detected.
public struct UndocumentedPayload: Sendable, Hashable {
/// Creates a new payload.
public init() {}

/// The header fields contained in the response.
public var headerFields: HTTPFields

/// The body stream of this part, if present.
public var body: HTTPBody?

/// Creates a new part.
/// - Parameters:
/// - headerFields: The header fields contained in the response.
/// - body: The body stream of this part, if present.
public init(headerFields: HTTPFields = [:], body: HTTPBody? = nil) {
self.headerFields = headerFields
self.body = body
}
}
7 changes: 7 additions & 0 deletions Sources/OpenAPIRuntime/Deprecated/Deprecated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ import Foundation
import HTTPTypes

// MARK: - Functionality to be removed in the future

extension UndocumentedPayload {
/// Creates a new payload.
@available(*, deprecated, renamed: "init(headerFields:body:)") @_disfavoredOverload public init() {
self.init(headerFields: [:], body: nil)
}
}