Skip to content

Descriptive errors #12

Open
Open
@MiguelSavignano

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

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