@@ -711,10 +711,10 @@ sub _validate_path_parameter ($self, $state, $param_obj, $path_captures) {
711
711
' missing path parameter: %s' , $param_obj -> {name })
712
712
if not exists $path_captures -> {$param_obj -> {name }};
713
713
714
- my $value = $path_captures -> {$param_obj -> {name }};
715
- $value .= ' ' ;
714
+ my $data = $path_captures -> {$param_obj -> {name }};
715
+ $data .= ' ' ;
716
716
717
- return $self -> _validate_parameter_content({ %$state , depth => $state -> {depth }+1 }, $param_obj , \$value )
717
+ return $self -> _validate_parameter_content({ %$state , depth => $state -> {depth }+1 }, $param_obj , \$data )
718
718
if exists $param_obj -> {content };
719
719
720
720
return E({ %$state , keyword => ' style' }, ' only style: simple is supported in path parameters' )
@@ -725,7 +725,7 @@ sub _validate_path_parameter ($self, $state, $param_obj, $path_captures) {
725
725
return E($state , ' deserializing to non-primitive types is not yet supported in path parameters' );
726
726
}
727
727
728
- $self -> _evaluate_subschema(\$value , $param_obj -> {schema }, { %$state , schema_path => $state -> {schema_path }.' /schema' , stringy_numbers => 1, depth => $state -> {depth }+1 });
728
+ $self -> _evaluate_subschema(\$data , $param_obj -> {schema }, { %$state , schema_path => $state -> {schema_path }.' /schema' , stringy_numbers => 1, depth => $state -> {depth }+1 });
729
729
}
730
730
731
731
sub _validate_query_parameter ($self , $state , $param_obj , $uri ) {
@@ -739,15 +739,17 @@ sub _validate_query_parameter ($self, $state, $param_obj, $uri) {
739
739
return 1;
740
740
}
741
741
742
- return $self -> _validate_parameter_content({ %$state , depth => $state -> {depth }+1 }, $param_obj , \ $query_params -> {$param_obj -> {name }})
742
+ my $data = $query_params -> {$param_obj -> {name }};
743
+
744
+ return $self -> _validate_parameter_content({ %$state , depth => $state -> {depth }+1 }, $param_obj , \$data )
743
745
if exists $param_obj -> {content };
744
746
745
747
# §4.8.12.2.1: "If `true`, clients MAY pass a zero-length string value in place of parameters that
746
748
# would otherwise be omitted entirely, which the server SHOULD interpret as the parameter being
747
749
# unused."
748
750
return if $param_obj -> {allowEmptyValue }
749
751
and ($param_obj -> {style }//' form' ) eq ' form'
750
- and not length ($query_params -> { $param_obj -> { name }} );
752
+ and not length ($data );
751
753
752
754
# TODO: check 'allowReserved'; difficult to do without access to the raw request string
753
755
@@ -765,7 +767,7 @@ sub _validate_query_parameter ($self, $state, $param_obj, $uri) {
765
767
}
766
768
767
769
$state = { %$state , schema_path => $state -> {schema_path }.' /schema' , stringy_numbers => 1, depth => $state -> {depth }+1 };
768
- $self -> _evaluate_subschema(\ $query_params -> { $param_obj -> { name }} , $param_obj -> {schema }, $state );
770
+ $self -> _evaluate_subschema(\$data , $param_obj -> {schema }, $state );
769
771
}
770
772
771
773
# validates a header, from either the request or the response
@@ -818,7 +820,7 @@ sub _validate_header_parameter ($self, $state, $header_name, $header_obj, $heade
818
820
}
819
821
820
822
$state = { %$state , schema_path => $state -> {schema_path }.' /schema' , stringy_numbers => 1, depth => $state -> {depth }+1 };
821
- $self -> _evaluate_subschema(\ $data , $header_obj -> {schema }, $state );
823
+ $self -> _evaluate_subschema(\$data , $header_obj -> {schema }, $state );
822
824
}
823
825
824
826
sub _validate_cookie_parameter ($self , $state , $param_obj , $request ) {
0 commit comments