CLASS
Problem
Contents
- Properties
type
metadata
title
messages
links
- Methods
init(from:)
encode(to:)
==(_:_:)
public class Problem: ProblemRepresentation, Equatable
Problem response indicates an error occurred on the server. Responses of this type obey the schema defined in RFC-7807 (Problem Details for HTTP APIs).
Properties
type
public let type: ProblemType
metadata
public let metadata: Metadata?
An optional object with additional information about the response. A client may ignore the information present in this object.
title
public let title: Message?
An optional Message
that represents the title of the problem.
messages
public let messages: [UserMessage]
An optional array of UserMessage
that represents the messages that should be displayed to users to help them understand the context of an interaction.
links
public let links: [Link]
An array of Link
that represents the links that may be used to offer an user alternative flows.
Methods
init(from:)
public required init(from decoder: Decoder) throws
Parameters
Name | Description |
---|---|
decoder | The decoder to read data from. |
encode(to:)
public func encode(to encoder: Encoder) throws
Parameters
Name | Description |
---|---|
encoder | The encoder to write data to. |
==(::)
public static func == (lhs: Problem, rhs: Problem) -> Bool
Parameters
Name | Description |
---|---|
lhs | A value to compare. |
rhs | Another value to compare. |