You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to move from object_links (or object_get) to dag_get, since the former are deprecated.
dag_get currently returns Bytes. I selected DagCodec::Json for the encoding, and the returned value is indeed JSON, but cannot be parsed as DagGetResponse. I'm not sure if this type is even intended for this use case, but I figured, from the name...
Request code:
let object_links_resp_raw = client
.dag_get_with_options(DagGet{path: cid,codec:Some(DagCodec::Json),}).map_ok(|chunk| chunk.to_vec()).try_concat().await.context("unable to object links")?;println!("{:?}",String::from_utf8(object_links_resp_raw.clone()));let object_links_resp = serde_json::from_slice::<DagGetResponse>(&object_links_resp_raw).context("unable to decode response")?;
I'm trying to move from
object_links
(orobject_get
) todag_get
, since the former are deprecated.dag_get
currently returnsBytes
. I selectedDagCodec::Json
for the encoding, and the returned value is indeed JSON, but cannot be parsed asDagGetResponse
. I'm not sure if this type is even intended for this use case, but I figured, from the name...Request code:
which gives me this JSON:
pretty:
which does not fit
DagGetResponse
:Field names are PascalCase,
data
is ... something, but not a String.I'm not sure if the format changed at some point, since there is a test case for a different (old?) format...
The text was updated successfully, but these errors were encountered: