{ "description": "RecordPath parsing tests: type classification (scalar vs vector) and validity.", "type_tests": [ { "description": "simple key is scalar", "path": "text", "type": "scalar" }, { "description": "dotted path is scalar", "path": "subject.uri", "type": "scalar" }, { "description": "deeply nested path is scalar", "path": "a.b.c.d.e", "type": "scalar" }, { "description": "scalar union is scalar", "path": "embed{app.bsky.embed.record}.record.uri", "type": "scalar" }, { "description": "bare array is vector", "path": "tags[]", "type": "vector" }, { "description": "array with trailing key is vector", "path": "items[].name", "type": "vector" }, { "description": "union array is vector", "path": "features[app.bsky.richtext.facet#link].uri", "type": "vector" }, { "description": "nested arrays is vector", "path": "groups[].items[]", "type": "vector" }, { "description": "scalar union + array is vector", "path": "embed{app.bsky.embed.images}.images[].alt", "type": "vector" }, { "description": "escaped dot does not make it vector", "path": "dot!.key", "type": "scalar" }, { "description": "escaped bracket does not make it vector", "path": "a![0!]", "type": "scalar" }, { "description": "$type path is scalar", "path": "$type", "type": "scalar" } ], "invalid_tests": [ { "description": "empty string", "path": "", "note": "a RecordPath must have at least one segment" }, { "description": "unclosed square bracket", "path": "field[", "note": "missing closing ]" }, { "description": "unclosed curly brace", "path": "field{nsid", "note": "missing closing }" }, { "description": "unopened square bracket", "path": "field]", "note": "missing opening [" }, { "description": "unopened curly brace", "path": "field}nsid", "note": "missing opening {" }, { "description": "trailing dot", "path": "field.", "note": "empty segment after dot" }, { "description": "leading dot", "path": ".field", "note": "empty segment before dot" }, { "description": "double dot", "path": "a..b", "note": "empty segment between dots" }, { "description": "escape followed by a non-escapable character", "path": "field!s", "note": "escape character with nothing to escape" }, { "description": "lone escape at end of input", "path": "field!", "note": "escape character with nothing to escape" } ] }