{"record":{"id":"004c2f0ec01b2dfa","repo":"pathwaycom/pathway","slug":"invalid-json-pointer-for-field-field-name-r-pa","errorCode":null,"errorMessage":"Invalid JSON Pointer for field {field_name!r}: {path!r}. JSON Pointers (RFC 6901) must be empty or start with '/' (e.g. '/foo/bar').","messagePattern":"Invalid JSON Pointer for field (.+?): (.+?)\\. JSON Pointers \\(RFC 6901\\) must be empty or start with '/' \\(e\\.g\\. '/foo/bar'\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/_utils.py","lineNumber":393,"sourceCode":"            )\n        if json_field_paths is not None:\n            schema_columns = set(schema.column_names())\n            for field_name, path in json_field_paths.items():\n                if field_name == METADATA_COLUMN_NAME:\n                    raise ValueError(\n                        f\"'json_field_paths' cannot be used for \"\n                        f\"{METADATA_COLUMN_NAME!r}: the connector populates \"\n                        f\"this column itself when 'with_metadata=True', so \"\n                        f\"any JSON path would be silently ignored.\"\n                    )\n                if field_name not in schema_columns:\n                    raise ValueError(\n                        f\"'json_field_paths' references field {field_name!r} \"\n                        f\"which is not in the schema. Known fields: \"\n                        f\"{sorted(schema_columns)}.\"\n                    )\n                if path != \"\" and not path.startswith(\"/\"):\n                    raise ValueError(\n                        f\"Invalid JSON Pointer for field {field_name!r}: \"\n                        f\"{path!r}. JSON Pointers (RFC 6901) must be empty \"\n                        f\"or start with '/' (e.g. '/foo/bar').\"\n                    )\n        return schema, api.DataFormat(\n            **api_schema,\n            format_type=data_format_type,\n            column_paths=json_field_paths,\n            schema_registry_settings=maybe_schema_registry_settings(\n                schema_registry_settings\n            ),\n        )\n    else:\n        raise ValueError(f\"data format `{format}` not supported\")\n\n\ndef check_raw_and_plaintext_only_kwargs_for_message_queues(f):\n    default_format = inspect.signature(f).parameters[\"format\"].default","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/_utils.py#L375-L411","documentation":"Raised when a value in 'json_field_paths' is a non-empty string that does not start with '/'. Pathway locates values inside incoming JSON messages using JSON Pointers as defined in RFC 6901, where a pointer is either the empty string (the whole document) or a slash-prefixed path such as '/foo/bar'. Anything else (e.g. 'foo.bar' or 'foo/0') is rejected before the pipeline starts.","triggerScenarios":"Passing json_field_paths={'user': 'user'} or {'ts': '.timestamp'} instead of {'user': '/user'}; porting code from a connector that accepted dot-separated paths; forgetting that array indices are written as '/items/0/id'.","commonSituations":"Developers coming from jq-style or dot-path configs who write 'meta.id' instead of '/meta/id'; the empty-string case is valid (whole payload) which surprises people and leads to guessing at path syntax.","solutions":["Prefix every non-empty path with '/', e.g. 'user' -> '/user', 'meta.id' -> '/meta/id'.","Use '' (empty string) only when the column should receive the entire JSON document.","Check the message text: it names the exact field whose path is malformed."],"exampleFix":"# before\njson_field_paths={'user': 'user', 'meta_id': 'meta.id'}\n\n# after\njson_field_paths={'user': '/user', 'meta_id': '/meta/id'}","handlingStrategy":"validation","validationCode":"def validate_json_pointers(json_field_paths):\n    bad = {f: p for f, p in json_field_paths.items() if p != \"\" and not p.startswith(\"/\")}\n    assert not bad, f\"Paths must be RFC 6901 pointers (empty or '/...' ): {bad}\"","typeGuard":"def is_valid_pointer(path: str) -> bool:\n    return path == \"\" or path.startswith(\"/\")","tryCatchPattern":"try:\n    t = pw.io.kafka.read(..., json_field_paths=paths)\nexcept ValueError as e:\n    if \"Invalid JSON Pointer\" in str(e):\n        paths = {f: ('/' + p.lstrip('./')) for f, p in paths.items()}\n        t = pw.io.kafka.read(..., json_field_paths=paths)\n    else:\n        raise","preventionTips":["Always write pointers slash-first: '/a/b', array index as '/items/0'.","Add a unit check that every path in json_field_paths is '' or startswith('/')."],"tags":["pathway","connector","json-pointer","rfc6901","validation"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}