Fix JSON format documentation.
Extracted common JSON warning test logic to #collect_json_warnings.