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