fix(spec): ignore empty string for multi-value parameter (#9511)

Refs #9266 
Refs #5176 

Co-authored-by: Julien Bourges <julien.bourges@actility.com>
Co-authored-by: Oliwia Rogala <oliwia.rogala@smartbear.com>
This commit is contained in:
Julien
2024-02-15 09:38:48 +01:00
committed by GitHub
parent f04a542489
commit 0ce05095af
2 changed files with 9 additions and 2 deletions

View File

@@ -374,6 +374,9 @@ export function parameterValues(state, pathMethod, isXml) {
let paramValues = operationWithMeta(state, ...pathMethod).get("parameters", List())
return paramValues.reduce( (hash, p) => {
let value = isXml && p.get("in") === "body" ? p.get("value_xml") : p.get("value")
if (List.isList(value)) {
value = value.filter(v => v !== "")
}
return hash.set(paramToIdentifier(p, { allowHashes: false }), value)
}, fromJS({}))
}