Skip to content

Descriptive errors #12

Description

@MiguelSavignano

With the invalid operation, missing document key or missing object key the error is the same JSON::PatchError

Example:
Missing document key path

operations = [{"op": "replace", "value": "BAZZ"}]
item = {foo: "bazz"}
JSON::Patch.new(item, operations).call
# => JSON::PatchError

Invalid operation replaces

operations = [{"op": "replaces", path: "/foo", "value": "BAZZ"}]
item = {foo: "bazz"}
JSON::Patch.new(item, operations).call
# => JSON::PatchError

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions