Forum Discussion
https://stackoverflow.com/questions/21772221/java-to-json-string-ignore-null-values?r=SearchResults
Thanks for the update.. The link you have provided doesn't help. because my requirement is POST method, and i am getting the data from the custom properties in my Request payload,
- richie4 years agoCommunity HeroHey doubtsreadyapi,
Ive only just seen this post. Apologies.
Im not understanding. You say the table names are null but this is a POST request. I dont understand why if its a POST the tables names are null. Dont you control whats going in your POST?
I might be able to help if i understand your issue properly.
Cheers fella,
Rich- doubtsreadyapi4 years agoContributor
Hi richie
Thanks for the update..
Here are the steps i am following
Step 1: I am doing JDBC connection and getting the list of tables.
Step 2: using groovy script using json node value i am picking random tables and storing in custom variables.
Step3: what ever the tables i stored in Custom variables i am using in my POST request.
So in Step 2: some times the JSON node will return null or empty table names. So while posting the POST request i am sending the Table names with NULL or empty. Because of that in backend jobs are failing since we are sending the parameter with NULL or empty. so i want to know while sending the POST request i dont want to send the values which are NULL or empty.
Hope this is understandable.
- HimanshuTayal4 years agoCommunity Hero
Then you apply a logic at Step 2 (Groovy Step) not to store empty values to custom properties.
If need help in that please share you code 🙂
Related Content
- 4 years agoCapricornus