From 87b09875b40bab117a50c0f280b8664f1168ac3c Mon Sep 17 00:00:00 2001 From: Kylie Geller Date: Tue, 7 Nov 2023 13:33:02 -0500 Subject: [PATCH] escaping strings that are vars --- scripts/schema/cleaner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/schema/cleaner.py b/scripts/schema/cleaner.py index f6c68f4337..46a9a89977 100644 --- a/scripts/schema/cleaner.py +++ b/scripts/schema/cleaner.py @@ -281,7 +281,7 @@ def check_example_value(field: Union[List, FieldEntry], strict: Optional[bool] = if isinstance(example_value, (list, dict)): field_name: str = field['field_details']['name'] - msg: str = f"Example value for field `{field_name}` contains an object or array which must be quoted to avoid YAML interpretation." + msg: str = f"Example value for field `{{field_name}}` contains an object or array which must be quoted to avoid YAML interpretation." strict_warning_handler(msg, strict) # Examples with arrays must be handled @@ -301,7 +301,7 @@ def check_example_value(field: Union[List, FieldEntry], strict: Optional[bool] = if expected_values: for example_value in example_values: if example_value not in expected_values: - msg = f"Example value `{example_value}` for field `{name}` is not one of the values defined in `expected_value`: {expected_values}." + msg = f"Example value `{example_value}` for field `{{name}}` is not one of the values defined in `expected_value`: {expected_values}." strict_warning_handler(msg, strict)