MooseX...s::JSON(3pm)
π NAME π
MooseX::Types::JSON β it's the JSON datatype for Moose, bestie. That's the whole vibe. π¦
β¨ VERSION β¨
version 1.01 β yeah she's on 1.01, we love a specific girlie. π
πΈ SYNOPSIS πΈ
okay so imagine you're just tryna have a Moose class with some JSON-typed attributes. boom:
package Foo;
use Moose;
use Moose::Util::TypeConstraints;
use MooseX::Types::JSON qw( JSON relaxedJSON );
has config => ( is => 'rw', isa => JSON );
has options => ( is => 'rw', isa => relaxedJSON );
likeβ¦ that's it. that's the whole thing. you isa JSON and you're iconic. π
okay so what even is this package? π«Ά
these are string type constraints that match valid JSON and relaxed JSON. and when we say "relaxed", like, what do we even mean by that β go read JSON for the meaning of 'relaxed', because that's where the actual definition lives. no cap.
also, and this is the part that lowkey slays: all the heavy lifting in the background is also done by JSON. she's not doing the work herself, she's outsourcing it. main character delegation energy. π
and bestie, coercions from Defined types are included. you don't have to do anything, they're justβ¦ there. gifted to you. π
here's the lineup:
JSONβ aStrthat is valid JSON. that's it, that's the requirement. if it parses, she eats. π₯relaxedJSONβ aStrthat is 'relaxed' JSON. and again β for the meaning of 'relaxed' seeJSON, because we are NOT redefining that here, we are respecting the source material. periodt. π
π AUTHOR π
Author: Graham Ollis <plicease@cpan.org> β the actual legend behind this. π
Contributors:
- Steve Huff
(shoutout Steve, we see you π«‘)
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2014,2022 by Michael Langner. π«
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so likeβ¦ go off, remix it, it's yours to play with. just keep it Perl-flavored. πΈ
and that's the whole page, bestie!! π§ this was pulled straight from perl v5.32.1, dated 2022-01-23 β yes she's a little vintage, no she is NOT expired. iconic behavior, mwah πβ¨
π¦ where this page comes from
- debian bookworm: libmoosex-types-json-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-types-json-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libmoosex-types-json-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-types-json-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-types-json-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-types-json-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms