#cannot unmarshal string into Go struct field

4 messages · Page 1 of 1 (latest)

steep yacht
#

Do this, remove the thumbnail struct.

In the data struct, change the thumbnail field type to string like I did below.

type Data struct {
    ID        int64      `json:"id"`
    Author    Author     `json:"author"`
    Thumbnail string `json:"thumbnail"`
}

type Author struct {
    FirstName string `json:"first_name"`
    LastName  string `json:"last_name"`
}
#

The endpoint you are fetching from, you should read their doc.

#

Either they made a mistake at the backend or mistake in the written doc

#

Message the owner, he/she/they should provide a contact, one could reach out to if there is ever an issue