Interface MergePatchError

All Known Implementing Classes:
MergePatchError.DuplicateName, MergePatchError.TargetDuplicateName, MergePatchError.ValueNotRepresentable

An error of a JSON Merge Patch.

RFC 7396 defines a result for each pair of a target and a patch, so a merge patch has no errors of its own. These errors come from limits of the models, and from duplicate member names, which have no defined value (RFC 8259, Section 4).

Each error has a path: the reference tokens of a location, as in a JSON Pointer (RFC 6901). A token is a member name, or an array index in decimal. The root has no tokens.

Error Cause
MergePatchError.DuplicateName an object of the patch document has a member name more than once
MergePatchError.TargetDuplicateName an object of the target has a member name more than once, and the patch changes that member
MergePatchError.ValueNotRepresentable the target model cannot hold a number of a value of the patch
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    An object of the patch document has a member name more than once.
    static final record 
    An object of the target has a member name more than once, and the patch has a member with that name for the object.
    static final record 
    The target model cannot hold a number of a value of the patch, for example 1e99999999999 in a Jackson tree.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Returns a description of the error for people.
  • Method Details

    • message

      default String message()
      Returns a description of the error for people.
      Returns:
      the description