#I want to convert a json object to string in groovy

1 messages · Page 1 of 1 (latest)

glad yew
#

I have a json file and I want to store it in a variable in a string format

sudden veldtBOT
#

<@&987246399047479336> please have a look, thanks.

sudden veldtBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

jade tide
#

Wdym store in a string format?

#

Extract a particular string form it?
Read the file itself?
Parse the json to an object and convert that to a string?

glad yew
#

Store the json object as a string

#

I have a json file in a git repo When i pull the file I get the response body in raw json format

#

I want to remove the '\n' character using regex

#

So i want to convert the json object to string

#

Then filter the characters using regex and then parse it again to a json object

jade tide
#

U can directly parse it to a json object too

#

Instead of all that manual string operations

glad yew
#

The response body is already a json object I cannot parse it again as a json object

#

I need to convert it to a string