My OpenAPI schema requires application/json content, but plug-in's valid_input reports true (no errors) no receiving a request with content text/plain, regardless of the actual content.
Code in the validator only checks that content-type exists, not that it matches the required type(s):
if (@{$param->{accepts}} and !$val->{content_type}) {
$val->{valid} = 0;
return E "/$param->{name}", [join(', ', @{$param->{accepts}}) => type => $val->{content_type}];
}
Here are the contents of variables at this point (from the perl debugger -- line number don't match because i inserted a $DB::single in there...
My OpenAPI schema requires
application/json
content, but plug-in'svalid_input
reports true (no errors) no receiving a request with contenttext/plain
, regardless of the actual content.Code in the validator only checks that content-type exists, not that it matches the required type(s):
https://metacpan.org/release/JSON-Validator/source/lib/JSON/Validator/Schema/OpenAPIv3.pm#L271
Here are the contents of variables at this point (from the perl debugger -- line number don't match because i inserted a
$DB::single
in there...