[metadata] Add functions to write and read json files

5 jobs for !2687 with feature/metadata-extraction
merge request