Test error on missing field during toJson()