->openapi->valid_input mangles headers
tomascohen opened this issue · comments
Tomas Cohen Arazi commented
Just that, once you call it, headers get touched in bad ways :-D
Jan Henning Thorsen commented
That is by design: Specifying a collectionFormat will turn the input data into an array. I think you might have been tricked by two things:
- The default collectionFormat is "csv" and not "multi".
- https://docs.mojolicious.org/Mojo/Headers#header returns
join ", ", @$headers
in case there are multiple values. (That should probably be documented though)
Also since a collectionFormat turns the string into an array, then you cannot validate the input twice.