FHIRValidationError

public struct FHIRValidationError: Error, CustomStringConvertible

Errors thrown during serialization and deserialization.

  • The error type.

    Declaration

    Swift

    public var code: FHIRValidationErrorType
  • key

    The property key to which the error applies; may be empty for errors raised by primitives.

    Declaration

    Swift

    public var key: String
  • The path to the key, excluding the key itself.

    Declaration

    Swift

    public var path: String?
  • The full path to the property.

    Declaration

    Swift

    public var fullPath: String
  • The type expected for values of this key.

    Declaration

    Swift

    public var wants: Any.Type?
  • has

    The type received for this key.

    Declaration

    Swift

    public var has: Any.Type?
  • A problem description.

    Declaration

    Swift

    public var problem: String?
  • Sub-errors.

    Declaration

    Swift

    public var subErrors: [FHIRValidationError]?
  • Initializer to use when a given key is missing.

    Declaration

    Swift

    public init(missing key: String)

    Parameters

    key

    The missing key

  • Initializer to use when a given key is present but is not expected.

    Declaration

    Swift

    public init(unknown key: String, ofType type: Any.Type)

    Parameters

    key

    The unknown key

    type

    The type of the object associated with the unknown key

  • Initializer to use when there is a problem with a given key (other than the key missing or being unknown).

    Declaration

    Swift

    public init(key: String, problem: String)

    Parameters

    key

    The problematic key

    problem

    A description of the problem

  • Initializer to use when the value of the given key is of a wrong type.

    Declaration

    Swift

    public init(key: String, wants: Any.Type, has: Any.Type)

    Parameters

    key

    The key for which there is a type mismatch

    wants

    The type expected for the key

    has

    The (wrong) type received for the key

  • Initializer to use for a validation error containing child errors. The key will be set to an empty string, the parent will need to fill this value.

    Declaration

    Swift

    public init(errors: [FHIRValidationError])

    Parameters

    errors

    The errors to contain

  • Undocumented

    Declaration

    Swift

    public struct FHIRValidationError: Error, CustomStringConvertible
  • Declaration

    Swift

    public var description: String