From 42d372c860f991008eb58c8354e29ee9832c6693 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Wed, 4 Nov 2020 18:58:33 +0100 Subject: [PATCH] Working --- Snapshot.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Snapshot.go b/Snapshot.go index c57cb16..d140a76 100644 --- a/Snapshot.go +++ b/Snapshot.go @@ -7,6 +7,10 @@ import ( "io/ioutil" ) +type SnapshotListResponse struct { + Snapshots []*SnapshotRecord `json:"snapshots"` +} + type SnapshotRecord struct { Id int `json:"id"` SnapshotSubmission @@ -37,7 +41,7 @@ func createSnapshotSubFromJsonBodyStream(jsonBodyStream io.ReadCloser) (*Snapsho } func createJsonFromSnapshotRecords(records []*SnapshotRecord) ([]byte, error) { - jsonResult, err := json.Marshal(records) + jsonResult, err := json.Marshal(SnapshotListResponse{records}) if err != nil { return nil, err }