jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
53 stars 41 forks source link

Warnings after update to latest release #224

Closed ure closed 2 years ago

ure commented 2 years ago

Hi there,

After we did an update to the latest release (coming from the previous release) we get these Use of uninitialized value in string eq at /app/local/lib/perl5/Mojolicious/Plugin/OpenAPI/Parameters.pm line 131. I'll take a look in the code lateron

ure commented 2 years ago

elsif (ref $param->{schema} eq 'HASH' and schema_type($param->{schema}) eq 'string') {

shouldn't this be

elsif (defined $param->{schema} && (ref $param->{schema} eq 'HASH' and schema_type($param->{schema}) eq 'string') ) {

jhthorsen commented 2 years ago

ref will never return "undef", so the issue was how schema_type() was used. Will be part of the next release.