NAME

Struct::Path::JsonPointer - JsonPointer (rfc6901) syntax frontend for Struct::Path

Travis CI Coverage Status CPAN version

VERSION

Version 0.04

SYNOPSIS

use Struct::Path qw(path);
use Struct::Path::JsonPointer qw(str2path);

my $data = {
    "foo"   => ["bar", "baz"],
    ""      => 0,
    "a/b"   => 1,
    "c%d"   => 2,
    "e^f"   => 3,
    "g|h"   => 4,
    "i\\j"  => 5,
    "k\"l"  => 6,
    " "     => 7,
    "m~n"   => 8
};

my ($found) = path($data, str2path('/foo/0'), deref => 1);
print $found; # 'bar'

EXPORT

Nothing is exported by default.

SUBROUTINES

path2str

Convert Struct::Path path to JsonPointer.

$pointer = path2str($path);

str2path

Convert JsonPointer to Struct::Path path.

$path = str2path($pointer);

AUTHOR

Michael Samoglyadov, <mixas at cpan.org>

BUGS

Please report any bugs or feature requests to bug-struct-path-jsonpointer at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Struct-Path-JsonPointer. 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 Struct::Path::JsonPointer

You can also look for information at:

SEE ALSO

JSON::Pointer, rfc6901

Struct::Path, Struct::Path::PerlStyle, Struct::Diff

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.