I have many unit tests which takes JSON as input, however editing JSON embedded in a ABAP string is a mess. And no, ecatt test data containers is not an option, never use it for anything in unit tests, but its a different story.
One option is to use string templates,
DATA(json) = |\{\n| &&
| "hello": 2\n| &&
|\}|.
It does require escaping the squiggly brackets, so I tend to do the following instead,
DATA(json) = `{` && |\n| &&
` "hello": 2` && |\n| &&
`}`.
Which is also a mess, but easy to add when using
multi cursors.
After adding the JSON, I sometimes need to edit the JSON, and I typically mess it up, so the syntax is wrong or something else
😒
Lets add tooling to easily edit the JSON
😎

Introducing
abap-json-editor, right click the start of the ABAP string to open an new editor. Changes in the JSON editor is automatically validated and reflected in the ABAP code,

Plus it allows for easy pasting of JSON from clipboard,

The extension will work with standalone ABAP files, files from
ABAP fs by
murbani, plus on
web only
Immediately released to everyone
😅 bug reports and fixes welcome on
github.