MooseX::Types::JSON(3) JSON datatype for Moose


package Foo;
use Moose;
use Moose::Util::TypeConstraints;
use MooseX::Types::JSON qw( JSON );
has config => ( is => 'rw', isa => JSON );
has options => ( is => 'rw', isa => relaxedJSON );

String type constraints that match valid and relaxed JSON. For the meaning of 'relaxed' see JSON. All the heavy lifting in the background is also done by JSON.

Coercions from Defined types are included.

  • JSON

    A Str that is valid JSON.

  • relaxedJSON

    A Str that is 'relaxed' JSON. For the meaning of 'relaxed' see JSON.


Steve Huff


Michael Langner


If you'd like to contribute, just fork my repository (<>) on Github, commit your changes and send me a pull request.


Please report any bugs or feature requests at <>.


Copyright 2014 Michael Langner, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.