-
-
25 Oct 2018 21:09:47 UTC
- Distribution: JSON-Patch
- Module version: 0.04
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (1)
- Testers (944 / 0 / 0)
- Kwalitee
Bus factor: 0- 89.34% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (5.79KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Struct::Diff
- Struct::Path
- Struct::Path::JsonPointer
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
JSON::Patch - JSON Patch (rfc6902) for perl structures
VERSION
Version 0.04
SYNOPSIS
use Test::More tests => 2; use JSON::Patch qw(diff patch); my $old = {foo => ['bar']}; my $new = {foo => ['bar', 'baz']}; my $patch = diff($old, $new); is_deeply( $patch, [ {op => 'add', path => '/foo/1', value => 'baz'} ] ); patch($old, $patch); is_deeply($old, $new);
EXPORT
Nothing is exported by default.
SUBROUTINES
diff
Calculate patch for two arguments:
$patch = diff($old, $new);
Convert Struct::Diff diff to JSON Patch when single arg passed:
require Struct::Diff; $patch = diff(Struct::Diff::diff($old, $new));
patch
Apply patch.
patch($target, $patch);
AUTHOR
Michael Samoglyadov,
<mixas at cpan.org>
BUGS
Please report any bugs or feature requests to
bug-json-patch at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=JSON-Patch. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.SUPPORT
You can find documentation for this module with the perldoc command.
perldoc JSON::Patch
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
SEE ALSO
rfc6902, Struct::Diff, Struct::Diff::MergePatch
LICENSE AND COPYRIGHT
Copyright 2018 Michael Samoglyadov.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Module Install Instructions
To install JSON::Patch, copy and paste the appropriate command in to your terminal.
cpanm JSON::Patch
perl -MCPAN -e shell install JSON::Patch
For more information on module installation, please visit the detailed CPAN module installation guide.