jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
54 stars 44 forks source link

Array type parameters stringified from openapi->valid_input #208

Closed lafokamotion closed 3 years ago

lafokamotion commented 3 years ago

An array type query parameter which contains strings for the items is being "stringified" upon calling the openapi.valid_input helper.

The parameter's definition: image

The unexpected behavior where the dumped value both before and after the helper call is $c->req->param('foo'): image

This began occurring with the release of version 4.00 of the plugin. I also tested with alternate versions of collectionFormats and found the only unaffected collectionFormat was multi.

Not 100% on this but I think the issue can be tracked down to the _helper_validate sub in the plugin: Version 3.41 Version 4.02

lafokamotion commented 3 years ago

I forgot to mention that this was based on OpenAPI v2 and by switching my spec to OpenAPI v3, the array parameters are not experiencing this issue either.