| 1 | package JSV::Keyword::Draft4::MaxProperties; | ||||||||||
| 2 | |||||||||||
| 3 | 47 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 47 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 47 | ▶ | use parent qw(JSV::Keyword); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 47 | ▶ | use JSV::Keyword qw(:constants); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | sub instance_type() { INSTANCE_TYPE_OBJECT(); } | ||||||||||
| 9 | sub keyword() { "maxProperties" } | ||||||||||
| 10 | sub keyword_priority() { 10; } | ||||||||||
| 11 | |||||||||||
| 12 | 16 | ▶ | sub validate { | ||||||||
|
Subroutine
validate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 13 | 16 | my ($class, $context, $schema, $instance) = @_; | |||||||||
| 14 | |||||||||||
| 15 | 16 | my $keyword_value = $class->keyword_value($schema); | |||||||||
| 16 | |||||||||||
| 17 | 16 | ▶ | if (scalar keys %$instance > $keyword_value) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 4 | $context->log_error("The instance properties is greater than maxProperties value"); | |||||||||
| 19 | } | ||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 47 | 1; | |||||||||