It appears that if you have an optional param that has a type constraint (such as Enum from Types::Standard, or enum() from Moose::Util::TypeConstraints, then you will not get an Invalid Parameters response.
If the param is instead changed to requires, then you get the expected Invalid Parameters response.
For example
params(
optional('foo', type => Enum[qw(bar baz)])
)
get sub {
...
}
If called with foo=invalid, then a 200 OK response is received.
The problem is in Raisin::Request::prepare_params() I have a patch with a test case that I will submit as a PR shortly.
It appears that if you have an optional param that has a type constraint (such as
Enum
fromTypes::Standard
, orenum()
fromMoose::Util::TypeConstraints
, then you will not get anInvalid Parameters
response.If the param is instead changed to
requires
, then you get the expectedInvalid Parameters
response.For example
If called with
foo=invalid
, then a 200 OK response is received.The problem is in
Raisin::Request::prepare_params()
I have a patch with a test case that I will submit as a PR shortly.