Does any one have any tips for Unmarshaling respon...
# ask-the-community
Does any one have any tips for Unmarshaling responses from flyte admin (in Go)? For example when I send a GET to
with a execution id, the json response I get can't be Unmarshaled to the proper struct (located here). I'm especially having a hard time Unmarshaling `core.Literal`s
cc: @Yee @Kevin Su
@George D. Torres, can you share some of the code you're using? Also, can you paste a stacktrace of the error you're seeing?
@Eduardo Apolinario (eapolinario) thank you! I'm afk today, but I'll put that here tomorrow
@Eduardo Apolinario (eapolinario) I am taking my GET response from
(the raw json for that response is attached). Then I Unmarshal that into an
(which appears to be the correct output model according to the swagger docs) using the following code:
Copy code
data := admin.WorkflowExecutionGetDataResponse{}
err := json.Unmarshal(data_json, &data) // data_json is the raw response from flyte      

if err != nil {
        c.Data(status, "application/json", data_json) // return raw json
c.JSON(status, data) // return unmarshalled object as json
It does successfully Unmarshal, but the resulting unmarshaled object
in all of the places the literals should be (see unmarshalled json attachment).
hey @George D. Torres for json unmarshalling you'll want to use jsonpb, like we do here:
(it's frustrating because the json unmarshalling will happily not return an err even when it fails to populate the message 😞)
Appreciated! I'll give that a shot