{"id":"d1beab2766d1e329","repo":"pydantic/pydantic","slug":"model-config-json-schema-extra-json-schema-ext","errorCode":null,"errorMessage":"model_config['json_schema_extra']={json_schema_extra} should be a dict, callable, or None","messagePattern":"model_config\\['json_schema_extra'\\]=(.+?) should be a dict, callable, or None","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pydantic/json_schema.py","lineNumber":1741,"sourceCode":"                )\n            if root_json_schema_extra:\n                json_schema_extra = root_json_schema_extra\n\n        if isinstance(json_schema_extra, (staticmethod, classmethod)):\n            # In older versions of python, this is necessary to ensure staticmethod/classmethods are callable\n            json_schema_extra = json_schema_extra.__get__(cls)\n\n        if isinstance(json_schema_extra, dict):\n            json_schema.update(json_schema_extra)\n        elif callable(json_schema_extra):\n            if len(_typing_extra.signature_no_eval(json_schema_extra).parameters) > 1:\n                json_schema_extra = cast(Callable[[JsonDict, type[Any]], None], json_schema_extra)\n                json_schema_extra(json_schema, cls)\n            else:\n                json_schema_extra = cast(Callable[[JsonDict], None], json_schema_extra)\n                json_schema_extra(json_schema)\n        elif json_schema_extra is not None:\n            raise ValueError(\n                f\"model_config['json_schema_extra']={json_schema_extra} should be a dict, callable, or None\"\n            )\n\n        if hasattr(cls, '__deprecated__'):\n            json_schema['deprecated'] = True\n\n    def resolve_ref_schema(self, json_schema: JsonSchemaValue) -> JsonSchemaValue:\n        \"\"\"Resolve a JsonSchemaValue to the non-ref schema if it is a $ref schema.\n\n        Args:\n            json_schema: The schema to resolve.\n\n        Returns:\n            The resolved schema.\n\n        Raises:\n            RuntimeError: If the schema reference can't be found in definitions.\n        \"\"\"","sourceCodeStart":1723,"sourceCodeEnd":1759,"githubUrl":"https://github.com/pydantic/pydantic/blob/2e5f0e2b4218de31709f1cf9c5bc61ea97a68835/pydantic/json_schema.py#L1723-L1759","documentation":"Error \"model_config['json_schema_extra']={json_schema_extra} should be a dict, callable, or None\" thrown in pydantic/pydantic.","triggerScenarios":"Thrown at pydantic/json_schema.py:1741 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"2e5f0e2b4218de31709f1cf9c5bc61ea97a68835","analyzedAt":"2026-08-04T19:54:21.281Z","schemaVersion":2}