Skip to content

mrenvoize/Mojo-JSON-Patch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Mojo::JSON::Patch - JSON Patch

SYNOPSIS

use Mojo::JSON::Patch;
my $patch = Mojo::JSON::Patch->new([{op => 'add', path => '/foo', value => 'bar'}]);
$patch->apply($document);
my $data = $patch->data;

DESCRIPTION

Mojo::JSON::Patch is a partial implementation of RFC 6902. We do not support the specifications `test` operation at present.

ATTRIBUTES

Mojo::JSON::Patch implements the following attributes.

operations

my $operations = $patch->operations;
$patch = $patch->operations([{op => 'add', path => '/foo', value => 'bar'}]);

RFC 6902 compliant JSON data structure containing the operations to apply.

data

my $data = $patch->data;
$patch = $patch->data({foo => 'bar'});

RFC 4627 compliant JSON data structure.

METHODS

Mojo::JSON::Patch inherits all methods from Mojo::JSON::Pointer and implements the following new ones.

apply

$patch = $patch->apply($document);

Apply "operations" to "data".

new

my $patch = Mojo::JSON::Patch->new;
my $patch = Mojo::JSON::Patch->new([{op => 'add', path => '/foo', value => 'bar'}]);

Build new Mojo::JSON::Patch object.

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicious.org, JSON::Validator.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages