appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Feature] Smart JSON substitution enhancements

Open riodeuno opened this issue 4 years ago • 2 comments

Summary

Casting empty values appropriately and automatically can have a high impact when defining JSON payloads. Today, we need to write verbose ternary operations to cast them accordingly.

For example: undefined is considered incorrect in JSON, so we should have it automatically substituted to null during Smart JSON substitution

A screenshot of how verbose it is for users: smart-substitution

riodeuno avatar Mar 31 '21 19:03 riodeuno

@riodeuno @Nikhil-Nandagopal : The real behaviour indeed is to set it to null. When the API executes, smart substitution ensures that null values are set correctly and the JSON sent out is valid. Do you mean that the client should display this ? @hetunandu : Is this possible in smart substitution to handle undefined as null values?

trishaanand avatar Jul 14 '21 08:07 trishaanand

@trishaanand Yes. We should try to maintain the accuracy of the displayed evaluated values. If we're executing the API with the values substituted as null we should show this in the evaluated values display.

riodeuno avatar Aug 31 '21 06:08 riodeuno