Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
larshp
Active Contributor
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.

 
9 Comments
Labels in this area