| 1 | package MooseX::JSONSchema::AttributeTrait; | ||
| 2 | 3 | our $AUTHORITY = 'cpan:GETTY'; | |
| 3 | # ABSTRACT: Trait for JSON Schema attributes | ||
| 4 | 3 | $MooseX::JSONSchema::AttributeTrait::VERSION = '0.001'; | |
| 5 | 3 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 3 | has json_schema_description => ( | |
| 8 | is => 'ro', | ||
| 9 | isa => 'Str', | ||
| 10 | predicate => 'has_json_schema_description', | ||
| 11 | ); | ||
| 12 | |||
| 13 | 3 | has json_schema_type => ( | |
| 14 | is => 'ro', | ||
| 15 | isa => 'Str', | ||
| 16 | predicate => 'has_json_schema_type', | ||
| 17 | ); | ||
| 18 | |||
| 19 | 3 | has json_schema_args => ( | |
| 20 | is => 'ro', | ||
| 21 | isa => 'HashRef', | ||
| 22 | lazy_build => 1, | ||
| 23 | ); | ||
| 24 | 7 | ▶ | sub _build_json_schema_args {{}} |
|
Subroutine
_build_json_schema_args: called CC=1 SCAR=0.0
| |||
| 25 | |||
| 26 | 3 | has json_schema_property_data => ( | |
| 27 | is => 'ro', | ||
| 28 | isa => 'HashRef', | ||
| 29 | lazy_build => 1, | ||
| 30 | ); | ||
| 31 | 9 | ▶ | sub _build_json_schema_property_data { |
|
Subroutine
_build_json_schema_property_data: called CC=1 SCAR=0.0
| |||
| 32 | 9 | my ( $self ) = @_; | |
| 33 | return { | ||
| 34 | type => $self->json_schema_type, | ||
| 35 | description => $self->json_schema_description, | ||
| 36 | 9 | %{$self->json_schema_args}, | |
| 37 | }; | ||
| 38 | } | ||
| 39 | |||
| 40 | 3 | 1; | |
| 41 | |||
| 42 | __END__ | ||