It seems that CGI::Application itself doesn't declare a ->json_body method, but judging from the error message you get, you need to configure the JSON generator of that module to allow non-reference things to be output as JSON (strings).
The error message most likely comes from JSON::XS, so $whatever->json_generator->allow_nonref() maybe is the correct method call.
Looking at JSON CGI::Application, I see CGI::Application::Plugin::JSON, which uses JSON::Any, which doesn't really have a way to specify configuration to whatever module it instantiates. There is a hint of setting $ENV{JSON_ANY_CONFIG} in the code, which might work for you, because the plugin itself does not provide any way to give it a preconfigured JSON encoder. Bad plugin.
In reply to Re^4: Need same JSON response from Mojo & CGI::App
by Corion
in thread Need same JSON response from Mojo & CGI::App
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |