This plugin is a simple stringifier built because of Firebase's restrictions on data messages. Any key in the json body that contains .stringify
will be stringified before being sent on. .stringify
is not kept in the key name in the final json body.
insomnia-plugin-stringify
With the plugin installed and enabled, just add .stringify
to the end of any key whose value you'd like to stringify.
Ex:
{
"person":{
"id": "1234456",
"data": {
"name": "joe",
"job": "doctor",
"age": 25,
"payload.stringify": {
"hello": "world",
"insomnia": "plugin",
"number": 1
}
}
}
}
gets turned into
{
"person":{
"id": "1234456",
"data": {
"name": "joe",
"job": "doctor",
"age": 25,
"payload": "{\"hello\":\"world\",\"insomnia\":\"plugin\",\"number\":1}"
}
}
}
Note: .stringify
is not kept in the key after stringification.