You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2024. It is now read-only.
The parseRequest middleware does not allow empty arrays for specified parameters (e.g. /foo?username=), even when such a parameter's schema includes required: false and/or minItems: 0.
Error: The "username" query parameter is invalid ("")
JSON Schema validation error.
Invalid type: string (expected array)
at ono (c:\git\Observer\Apps\ObsNode\node_modules\ono\lib\index.js:62:17)
at parseParameter (c:\git\Observer\Apps\ObsNode\node_modules\swagger-express-middleware\lib\param-parser.js:148:11)
at c:\git\Observer\Apps\ObsNode\node_modules\swagger-express-middleware\lib\param-parser.js:35:35
at Array.forEach (native)
at parseSimpleParams (c:\git\Observer\Apps\ObsNode\node_modules\swagger-express-middleware\lib\param-parser.js:30:12)
at ...
I can temporarily workaround the problem by adding default: [] to the schema but that also sets the parameter to [] even if it was not specified at all (i.e. for both /foo and /foo?username=).
The text was updated successfully, but these errors were encountered:
The parseRequest middleware does not allow empty arrays for specified parameters (e.g.
/foo?username=
), even when such a parameter's schema includesrequired: false
and/orminItems: 0
.However, as I understand it from OAI/OpenAPI-Specification#305 and APIDevTools/swagger-parser#6, this should result in
[]
.I can temporarily workaround the problem by adding
default: []
to the schema but that also sets the parameter to[]
even if it was not specified at all (i.e. for both/foo
and/foo?username=
).The text was updated successfully, but these errors were encountered: