Fix/W-17655986/exchange asset is not able to pass value only false in the request #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Description
The issue occurred when setting ValueOnly to false in the exchange asset. Despite this configuration, the boolean value was not being recognized and included in the query parameters as expected. Instead, the request was passing an empty value.
This behavior was observed in the getVersionedActionExecution endpoint, where boolean parameters should have been explicitly included in the URL query string.
Solution
Updated the _valueFormModelItem method to correctly handle boolean values.
Ensured that when inputType is "boolean", false is explicitly preserved instead of being treated as an empty or undefined value.
Improved the extraction logic to correctly differentiate between required and optional fields while keeping boolean values intact.
Impact
Boolean parameters (e.g., false values) are now correctly included in query parameters.
Ensures that APIs relying on boolean query parameters behave as expected.
Prevents unexpected behavior where false values were previously omitted or replaced with an empty string.
Testing
Added unit tests to validate that false and true values are correctly passed in query parameters.
Screenshot in API console with solution and spec attached on the Bug reported