Repository: deepset-ai/haystack

Issue:
`OpensearchDocumentStore.custom_mapping` fails validation
**Describe the bug**
Trying to load an OpensearchDocumentStore with a JSON string as value for the `custom_mapping` field fails.

**Error message**
Validation fails as the string contains forbidden chars, like `*`

**Expected behavior**
This field should accept a string containing JSON data, and should validate that the string contains valid JSON.

**Additional context**
Reported by @ArzelaAscoIi 

**To Reproduce**
```python
import json
from haystack import Pipeline

configuration = {
    "version": "ignore",
    "components": [{
        "name": "DocumentStore",
        "type": "OpenSearchDocumentStore",
        "params": {
            "port": 9200,
            "scheme": "https",
            "verify_certs": False,
            "create_index": True,
            "content_field": "content",
            "search_fields": "content",
            "embedding_dim": 768,
            "embedding_field": "embedding",
            "excluded_meta_data": False,
            "custom_mapping": json.dumps({
                "mappings": {
                    "properties": {
                        "content": {
                            "type": "text"
                        },
                        "name": {
                            "type": "keyword"
                        }
                    }
                },
                "settings": {
                    "index": {
                        "knn": "true"
                    }
                },
            }),
            "host": "localhost",
            "username": "admin",
            "password": "admin"
        }
    },
    {
        "name": "Retriever",
        "type": "ElasticsearchRetriever",
        "params": {
            "document_store": "DocumentStore",
            "top_k": 5
        }
    }],
    "pipelines": [{
        "name": "query",
        "nodes": [{
            "name": "Retriever",
            "inputs": [
                "Query"
            ]
        }]
    }]
}

p = Pipeline.load_from_config(configuration, pipeline_name="query")
```

**FAQ Check**
- [X] Have you had a look at [our new FAQ page](https://haystack.deepset.ai/overview/faq)?



Discussion:

Resolving patch:
diff --git a/haystack/pipelines/config.py b/haystack/pipelines/config.py
--- 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):


Test patch:
diff --git a/test/pipelines/test_pipeline.py b/test/pipelines/test_pipeline.py
--- 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():