JSON::V...or::URI(3)
π NAME π
Okay so this is the JSON::V...or::URI(3) manual, officially filed under User Contributed Perl Documentation, and the class it's about is JSON::Validator::URI β Uniform Resource Identifier, bestie π
. That's the whole NAME moment, and yes she's iconic.
β¨ SYNOPSIS β¨
Here's the vibe in code, no cap:
use JSON::Validator::URI;
my $urn = JSON::Validator::URI->new('urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f');
my $url = JSON::Validator::URI->new('/foo');
my $url = JSON::Validator::URI->new('https://mojolicious.org');
πΈ DESCRIPTION πΈ
JSON::Validator::URI is a class for presenting both URL and URN. Lowkey very useful, highkey a little experimental.
This class is currently EXPERIMENTAL π§ͺπ.
π EXPORTED FUNCTIONS π
One exported function, and she's right here:
uri
$uri = uri;
$uri = uri $orig, $base;
Returns a new JSON::Validator::URI object from $orig and $base. Both variables can be either a string or a JSON::Validator::URI object. Fr fr, that's the whole tea π«Ά.
π ATTRIBUTES π
JSON::Validator::URI inherits all attributes from Mojo::URL and implements the following ones. So yes, the full Mojo::URL attribute inheritance is included, plus these extra sparkles β¨:
nid
$str = $uri->nid;
Returns the NID part of a URN. Examples: "uuid" or "iban" π.
nss
$str = $uri->nss;
Returns the NSS part of a URN. Example: "6e8bc430-9c3a-11d9-9669-0800200c9a66" π¦.
π¦ METHODS π¦
JSON::Validator::URI inherits all methods from Mojo::URL and implements the following ones. All the inherited method goodness is still there, plus these:
from_data
$str = $uri->from_data($data);
This method will generate a URN for $data. $data will be serialized using "encode_json" in Mojo::JSON before being used to generate an UUIDv5.
This method is EXPERIMENTAL and subject to change! π§ͺπ
parse
See "parse" in Mojo::URL π.
to_abs
See "to_abs" in Mojo::URL π.
to_string
See "to_string" in Mojo::URL π
.
to_unsafe_string
See "to_unsafe_string" in Mojo::URL π₯.
π SEE ALSO π
JSON::Validator
That's the whole page, bestie π β brought to you by perl v5.42.0, dated 2025-03-17, under the JSON::V...or::URI(3) manual name. Slay and stay safe π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-JSON-Validator 5.150.0-bp160.1.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms