jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Array type parameters stringified from openapi->valid_input

lafokamotion opened this issue · comments

commented

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

commented

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.