Skip to content
Merged
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
22 changes: 22 additions & 0 deletions Sources/OpenAPIRuntime/Conversion/ErrorExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ extension DecodingError {
)
)
}

/// Returns a decoding error used by the oneOf decoder when not a single
/// child schema decodes the received payload.
/// - Parameters:
/// - type: The type representing the oneOf schema in which the decoding
/// occurred.
/// - codingPath: The coding path to the decoder that attempted to decode
/// the type.
/// - Returns: A decoding error.
@_spi(Generated)
public static func failedToDecodeOneOfSchema(
type: Any.Type,
codingPath: [any CodingKey]
) -> Self {
DecodingError.valueNotFound(
type,
DecodingError.Context.init(
codingPath: codingPath,
debugDescription: "The oneOf structure did not decode into any child schema."
)
)
}
}

@_spi(Generated)
Expand Down