{"record":{"id":"74d03cd2ef7034cc","repo":"firecrawl/firecrawl","slug":"json-format-must-be-an-object-with-type-prompt","errorCode":null,"errorMessage":"json format must be an object with 'type', 'prompt', and 'schema' fields","messagePattern":"json format must be an object with 'type', 'prompt', and 'schema' fields","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"apps/python-sdk/firecrawl/v2/utils/validation.py","lineNumber":382,"sourceCode":"    # Already a dict or unsupported type\n    return schema if isinstance(schema, dict) else None\n\n\ndef _validate_json_format(format_obj: Any) -> Dict[str, Any]:\n    \"\"\"\n    Validate and prepare json format object.\n    \n    Args:\n        format_obj: Format object that should be json type\n        \n    Returns:\n        Validated json format dict\n        \n    Raises:\n        ValueError: If json format is missing required fields\n    \"\"\"\n    if not isinstance(format_obj, dict):\n        raise ValueError(\"json format must be an object with 'type', 'prompt', and 'schema' fields\")\n    \n    if format_obj.get('type') != 'json':\n        raise ValueError(\"json format must have type='json'\")\n    \n    # prompt is optional in v2; only normalize when present\n    # schema is recommended; if provided, normalize Pydantic forms\n    schema = format_obj.get('schema')\n    normalized = dict(format_obj)\n    if schema is not None:\n        normalized_schema = _normalize_schema(schema)\n        if normalized_schema is not None:\n            # Handle schema reference resolution similar to TypeScript implementation\n            if isinstance(normalized_schema, dict):\n                defs = normalized_schema.get(\"$defs\", {})\n                import json\n                schema_string = json.dumps(normalized_schema)\n                has_any_refs = (\n                    normalized_schema.get(\"$defs\") or","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/firecrawl/firecrawl/blob/656bffcc2883f1af5befe38766b1ff5f0469993a/apps/python-sdk/firecrawl/v2/utils/validation.py#L364-L400","documentation":"Error \"json format must be an object with 'type', 'prompt', and 'schema' fields\" thrown in firecrawl/firecrawl.","triggerScenarios":"Thrown at apps/python-sdk/firecrawl/v2/utils/validation.py:382 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":"656bffcc2883f1af5befe38766b1ff5f0469993a","analyzedAt":"2026-08-12T01:18:00.488Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}