this post was submitted on 03 Jul 2023
1 points (100.0% liked)

Lemmy Support

4655 readers
18 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

I can fetch the comments for a post using the API using:

comment/list?post_id=

and that works fine but I have a question about how to determine what comment is a reply to another/ determining the comment nesting/threading.

From what I can tell the only thing tying any two comments together is the comment.path prop.

Is that correct?

That prop seems to be in a format where each nested comment has the root parent path number followed by . then their unique number. And each subsequent comment is another number sequence after that and so on.

Example:

root comment:

{ 
     "comment": {
          "path": 12345
     }
}

child comment 1:

{ 
     "comment": {
          "path": 12345.327928
     }
}

Is this correct?

Can someone who has used this API explain how this works? There are no doc comments in the docs for the http client so I'm just winging it here.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago

Awesome. Didn't even know about that community. I'll take my woes over there.

Thanks!