This introduces golden tests for JSON instances. The way this works is that when the test does not find JSON files to compare against, it fails, but it also generates them. One is supposed to add the files to git, and rerun the tests (which will now mostly likely pass). If in the future the JSON instance changes, the test will hopefully catch it.
The way the tests are generated is a bit hacky and hard to reproduce, but hopefully it shouldn't be done too often. Basically, the wire-server code is patched to add some ad-hoc `Show` instances. Then the `Arbitrary` instances are used to generate random objects, which are then printed and end up in the `Golden.Generated` module as Haskell code. Some of this code is fixed by a sed script after the fact.
So to regenerate `Golden.Generated` one can do the following:
- apply the patch(es) in `libs/wire-api/test/golden/` with `git am`
- from libs/wire-api, run the `gentests.sh` script
- undo the patch (but keep the generated code)