Skip to content

Fix/W-17655986/exchange asset is not able to pass value only false in the request #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

alexpmule
Copy link
Contributor

@alexpmule alexpmule commented Feb 7, 2025

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

Screenshot 2025-02-07 at 9 52 16 PM

alexperez added 2 commits February 7, 2025 17:05
@alexpmule alexpmule self-assigned this Feb 8, 2025
@alexpmule alexpmule merged commit 6be50c9 into main Feb 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants