diff --git a/haystack/pipelines/config.py b/haystack/pipelines/config.py index 36ea6c1eb..8e1345a11 100644 --- a/haystack/pipelines/config.py +++ b/haystack/pipelines/config.py @@ -97,7 +97,10 @@ def read_pipeline_config_from_yaml(path: Path) -> Dict[str, Any]: return yaml.safe_load(stream) -JSON_FIELDS = ["custom_query"] # ElasticsearchDocumentStore.custom_query +JSON_FIELDS = [ + "custom_query", # ElasticsearchDocumentStore.custom_query + "custom_mapping", # ElasticsearchDocumentStore.custom_mapping +] def validate_config_strings(pipeline_config: Any): diff --git a/test/pipelines/test_pipeline.py b/test/pipelines/test_pipeline.py index 0d3e09eab..2f29e8b62 100644 --- a/test/pipelines/test_pipeline.py +++ b/test/pipelines/test_pipeline.py @@ -687,6 +687,9 @@ def test_validate_pipeline_config_component_with_json_input_valid(): validate_config_strings( {"components": [{"name": "test", "type": "test", "params": {"custom_query": '{"json-key": "json-value"}'}}]} ) + validate_config_strings( + {"components": [{"name": "test", "type": "test", "params": {"custom_mapping": '{"json-key": "json-value"}'}}]} + ) def test_validate_pipeline_config_component_with_json_input_invalid_key():