JSON::API::v1 - A JSON API object according to jsonapi.org v1 specification
version 0.002
use JSON::API::v1; my $object = JSON::API::v1->new( data => JSON::API::v1::Resource->new( ... ); ); $object->add_error(JSON::API::v1::Error->new(...)); $object->add_relationship(JSON::API::v1::Error->new(...));
This module attempts to make a Moose object behave like a JSON API object as defined by jsonapi.org. This object adheres to the v1 specification
This data object is there a JSON::API::v1::Resource lives.
This becomes an array ref of JSON::API::v1::Error once you start adding errors to this object object via add_error.
add_error
This becomes an array ref of JSON::API::v1::Resource once you start adding additional resources to this object object via add_included.
add_included
This is to tell the object it is a set and you can add data to it via add_data. It will in turn JSON-y-fi the data to an array of the data you've added. If you don't set this via the constructer, please read the documentation of "add_data" in JSON::API::v1
add_data
You can add individual JSON::API::v1::Resource objects to the toplevel object. If you have not set is_set the first call to this function will assume you're adding data and thus want to be a set.
You can add individual JSON::API::v1::Error objects to the toplevel object.
You can add individual JSON::API::v1::Resource objects to the toplevel object.
Wesley Schwengle <waterkip@cpan.org>
This software is Copyright (c) 2020 by Wesley Schwengle.
This is free software, licensed under:
The (three-clause) BSD License
To install JSON::API::v1, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::API::v1
CPAN shell
perl -MCPAN -e shell install JSON::API::v1
For more information on module installation, please visit the detailed CPAN module installation guide.