jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
56 stars 58 forks source link

$args variable is missed in the definition of "openapi.valid_input" #219

Closed KalessinD closed 4 years ago

KalessinD commented 4 years ago

Steps to reproduce the behavior

There exists the defenition of "openapi.valid_input" helper in Mojolicious::Plugin::OpenAPI package. Here it is:

$app->helper('openapi.valid_input' => sub { _helpervalidate($[0]) ? undef : $_[0] });

I suppose that the $_[1] argument was omitted in the call of "_helper_validate" method. That's why impossible to pass "$args" variable into this method.

The proper version of this line should look as follows:

$app->helper('openapi.valid_input' => sub { _helpervalidate($[0], $[1]) ? undef : $[0] });

Please fix it.

Expected behavior

EXPLAIN WHAT SHOULD HAPPEN HERE I expect that "$args" must be passed into "_helper_validate" method

Actual behavior

EXPLAIN WHAT HAPPENED INSTEAD HERE Right now the "$args" variable can't reach "_helper_validate" method as it was expected.

jhthorsen commented 4 years ago

Seems like this issue is created for the wrong github project.