json: Add mechanism for checking invalid files.