From 4907306b9cb9552733d01122cef81922ab2ab2e2 Mon Sep 17 00:00:00 2001 From: Maks Pikov Date: Sat, 2 May 2026 22:19:21 +0000 Subject: [PATCH] fix: don't send empty string for empty array params when 'send empty value' is checked When a multipart/form-data request has an array parameter with no items and the user checks 'Send empty value', the empty array was being serialized as an empty string () instead of being omitted. The root cause was in the requestBody filter logic: the requestBodyInclusionSetting flag was overriding the empty check for all value types, including arrays and nil values. Empty arrays (empty Immutable Lists) were converted to , then swagger-client's formatKeyValue converted to an empty string via . The fix ensures: - Empty arrays are always excluded (never serialized as empty strings) - Nil values (null/undefined) are only included when the 'send empty' flag is set AND the value is not null/undefined - Empty strings and other non-nil empty values are still properly handled by the inclusion flag Fixes #10785 --- src/core/plugins/spec/actions.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core/plugins/spec/actions.js b/src/core/plugins/spec/actions.js index 8ea0c5801b2..6fcc2f5b0b1 100644 --- a/src/core/plugins/spec/actions.js +++ b/src/core/plugins/spec/actions.js @@ -438,10 +438,15 @@ export const executeRequest = (req) => } ) .filter( - (value, key) => (Array.isArray(value) - ? value.length !== 0 - : !isEmptyValue(value) - ) || requestBodyInclusionSetting.get(key) + (value, key) => { + if (Array.isArray(value)) { + return value.length !== 0 + } + if (!isEmptyValue(value)) { + return true + } + return requestBodyInclusionSetting.get(key) && value != null + } ) .toJS() } else {