The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MooseX::JSONSchema - Adding JSON Schema capabilities to your Moose class

VERSION

version 0.001

SYNOPSIS

  package PersonClass;

  use Moose;
  use MooseX::JSONSchema;

  json_schema_title "A person";

  string first_name => "The first name of the person";
  string last_name => "The last name of the person";
  integer age => "Current age in years", json_schema_args => { minimum => 0, maximum => 200 };

  1;

  package CharacterClass;

  use Moose;
  use MooseX::JSONSchema;

  extends 'PersonClass';

  json_schema_title "Extended person";

  string job => "The job of the person";

  1;

  my $json_schema_json = PersonClass->meta->json_schema_json;

  my $person = PersonClass->new(
    first_name => "Peter",
    last_name => "Parker",
    age => 21,
  );

  my $json_schema_data_json = $person->json_schema_data_json;

DESCRIPTION

THIS API IS WORK IN PROGRESS

SUPPORT

Repository

  https://github.com/Getty/perl-moosex-jsonschema
  Pull request and additional contributors are welcome

Issue Tracker

  https://github.com/Getty/perl-moosex-jsonschema/issues

SUPPORT

Source Code

The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)

https://github.com/Getty/perl-moosex-jsonschema

  git clone https://github.com/Getty/perl-moosex-jsonschema.git

AUTHOR

Torsten Raudssus <torsten@raudss.us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2024 by Torsten Raudssus.

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