Replies: 1 comment 2 replies
-
Upon further investigation it looks like this is being caused by Phoenix behaviour on |
Beta Was this translation helpful? Give feedback.
-
Upon further investigation it looks like this is being caused by Phoenix behaviour on |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Looking for suggestions on where I'm going wrong.
Context, migrating to
open_api_spex
fromphoenix_swagger
. Inphoenix_swagger
the parameter had to be namedm[]
for everything to work. Using{:open_api_spex, "~> 3.16"}
First off, thank you for the library. So far the migration has been relatively painless with the exception of getting our m[] array query params to work.
There doesn't seem to be a simple way to get a Phoenix formatted query string array to work with both
CastAndValidate
and theSwaggerUI plug
. Getting either to work seems to break the other one.Taking this simple mock operation as an example:
That operation will happily take
?m[]=string1&m[]=string2
and validate properly w/CastAndValidate
. Problem is that if you useOpenApiSpex.Plug.SwaggerUI
and useTry it out
SwaggerUI will try to send it as?m=string2&m=string2
without the square brackets which results in the following validation error fromCastAndValidate
.Changing it to
"m[]"
as the name will get SwaggerUI to send it in properly as?m[]=string2&m[]=string2
but if you leave theCastAndValidate
plug in you'll end up with the following error (removing the plug allows it to work)I assume I'm missing something here as I believe a simple query string based string array should be possible but I couldn't find an example of one anywhere in the docs without another parent
:object
surrounding it. Also couldn't find much in the Swagger docs or threads other than suggestions to rename the parameter tom[]
.Beta Was this translation helpful? Give feedback.
All reactions