{"record":{"id":"72f548656b3e32f8","repo":"deepset-ai/haystack","slug":"no-jq-schema-nor-content-key-specified-set-ei","errorCode":null,"errorMessage":"No `jq_schema` nor `content_key` specified. Set either or both to extract data.","messagePattern":"No `jq_schema` nor `content_key` specified\\. Set either or both to extract data\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"haystack/components/converters/json.py","lineNumber":150,"sourceCode":"            An optional set of meta keys to extract from the content.\n            If `jq_schema` is specified, all keys will be extracted from that object.\n        :param store_full_path:\n            If True, the full path of the file is stored in the metadata of the document.\n            If False, only the file name is stored.\n        \"\"\"\n        self._compiled_filter = None\n        if jq_schema:\n            jq_import.check()\n            self._compiled_filter = jq.compile(jq_schema)\n\n        self._jq_schema = jq_schema\n        self._content_key = content_key\n        self._meta_fields = extra_meta_fields\n        self._store_full_path = store_full_path\n\n        if self._compiled_filter is None and self._content_key is None:\n            msg = \"No `jq_schema` nor `content_key` specified. Set either or both to extract data.\"\n            raise ValueError(msg)\n\n    def to_dict(self) -> dict[str, Any]:\n        \"\"\"\n        Serializes the component to a dictionary.\n\n        :returns:\n            Dictionary with serialized data.\n        \"\"\"\n        return default_to_dict(\n            self,\n            jq_schema=self._jq_schema,\n            content_key=self._content_key,\n            extra_meta_fields=self._meta_fields,\n            store_full_path=self._store_full_path,\n        )\n\n    @classmethod\n    def from_dict(cls, data: dict[str, Any]) -> \"JSONConverter\":","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/converters/json.py#L132-L168","documentation":"JSONConverter needs at least one extraction strategy: a jq_schema (a jq-style filter) or a content_key (a direct key to pull from each JSON object). If the compiled jq filter is absent and content_key is None, there is nothing to extract, so __init__ raises ValueError immediately at component construction time.","triggerScenarios":"Instantiating JSONConverter() with neither jq_schema nor content_key, e.g. JSONConverter() or JSONConverter(extra_meta_fields=[...]) only.","commonSituations":"Copy-pasting a JSONConverter init and deleting the parameters; serializing/deserializing YAML where both params were left blank; assuming a default extraction exists when it does not.","solutions":["Pass content_key='your_key' to extract the value under that key","Pass jq_schema='.' or a specific filter like jq_schema='[].name'","If you intended a no-op conversion, use a different component"],"exampleFix":"// before\nconverter = JSONConverter()\n// after\nconverter = JSONConverter(jq_schema=\".content\", content_key=\"text\")","handlingStrategy":"validation","validationCode":"def make_json_converter(jq_schema=None, content_key=None, **kw):\n    if jq_schema is None and content_key is None:\n        raise ValueError(\"Provide jq_schema or content_key\")\n    return JSONConverter(jq_schema=jq_schema, content_key=content_key, **kw)","typeGuard":null,"tryCatchPattern":"try:\n    converter = JSONConverter()\nexcept ValueError as e:\n    converter = JSONConverter(content_key=\"text\")","preventionTips":["Always pass either jq_schema or content_key when constructing JSONConverter","Test component construction in unit tests to fail fast on config regressions","Check serialized YAML for empty init_parameters after refactors"],"tags":["python","haystack","json-converter","configuration"],"backgroundTag":"missing-required-config","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}