Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

put $type in array path

nothing is escaped, unclear how universal the $type convention is, etc.

Changed files
+20 -8
link_aggregator
links
src
+12 -3
links/src/record.rs
···
}
}
JsonValue::Array(a) => {
-
let p = format!("{path}[]");
for child in a {
-
walk_record(&p, child, found)
}
}
JsonValue::String(s) => {
···
Link::Uri("https://youtu.be/oKXm4szEP1Q?si=_0n_uPu4qNKokMnq".into()),
),
l(
-
".facets[].features[].uri",
Link::Uri("https://youtu.be/oKXm4szEP1Q?si=_0n_uPu4qNKokMnq".into()),
),
]
···
}
}
JsonValue::Array(a) => {
for child in a {
+
let child_p = match child {
+
JsonValue::Object(o) => {
+
if let Some(JsonValue::String(t)) = o.get("$type") {
+
format!("{path}[{t}]")
+
} else {
+
format!("{path}[]")
+
}
+
}
+
_ => format!("{path}[]"),
+
};
+
walk_record(&child_p, child, found)
}
}
JsonValue::String(s) => {
···
Link::Uri("https://youtu.be/oKXm4szEP1Q?si=_0n_uPu4qNKokMnq".into()),
),
l(
+
".facets[].features[app.bsky.richtext.facet#link].uri",
Link::Uri("https://youtu.be/oKXm4szEP1Q?si=_0n_uPu4qNKokMnq".into()),
),
]