toJson

Converts the metadata to a JSON string.