coord-e / misskey-rs

:v: Client library for Misskey :smiling_face_with_three_hearts:
Apache License 2.0
59 stars 7 forks source link

invalid type: map, expected a sequence #73

Open spirillen opened 1 month ago

spirillen commented 1 month ago

Hi and thanks for making this Rust Crate library.

While I was directed here from the scripts I'm trying to learn to make, I've ran into this error message

MISSKEY_API_URL="https://matrix.rocks/api/" MISSKEY_TOKEN="API_KEY" ./mk-cleaner $UID
Doing $UID
Failed to get user $UID notes: JSON error: invalid type: map, expected a sequence at line 1 column 825
users suspended: 1, not suspended: 0
notes deleted: 0, not deleted: 1

For what I've been able to find on the little internet, it seems to relate to how the JSON response are handled. My Question is now, is this related to your Library?? If it is, is there any change you will picl up the project again and continue develop it?

I'm a hallo world rust-lang noob,

spirillen commented 3 weeks ago

After "A little help from my friends" found the problem. It seems that note.rs expects a vic for the emoji, while this should be a HashMap

@coord-e Any change this could be fixed zoon?

https://github.com/coord-e/misskey-rs/blob/a345a2dda1b6f3ef404da0b9f33c9faee9b575a7/misskey-api/src/model/note.rs#L157

Can see the problem repeats itself in version 0.3.0

https://github.com/coord-e/misskey-rs/blob/3519819c88241f4a7398ce802234865bbe68218c/misskey-api/src/model/note.rs#L157