From c56c758bf4c17b9ef228375f4d9f2da5c9a9d835 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Fri, 25 Apr 2014 23:47:35 -0400 Subject: [PATCH] full schema for series list method, this will get more sane when other methods share structs --- marvel.go | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/marvel.go b/marvel.go index b856968..afba6f3 100644 --- a/marvel.go +++ b/marvel.go @@ -76,10 +76,81 @@ func (c Client) Series(id int64, req CommonRequest) (resp struct { Data struct { commonList Results []struct { - ID int `json:"id"` - DigitalID int `json:"digitalId"` - } `json:"results"` - } `json:"data"` + ID int + Title string + Description string + ResourceURI string + URLs []struct { + Type string + URL string + } + StartYear int + EndYear int + Rating string + //Modified Date + Thumbnail struct { + Path string + Extension string + } + Comics struct { + Available int + Returned int + CollectionURI string + Items []struct { + ResourceURI string + Name string + } + } + Stories struct { + Available int + Returned int + CollectionURI string + Items []struct { + ResourceURI string + Name string + Type string + } + } + Events struct { + Available int + Returned int + CollectionURI string + Items []struct { + ResourceURI string + Name string + Type string + } + } + Characters struct { + Available int + Returned int + CollectionURI string + Items []struct { + ResourceURI string + Name string + Type string + } + } + Creators struct { + Available int + Returned int + CollectionURI string + Items []struct { + ResourceURI string + Name string + Type string + } + } + Next struct { + ResourceURI string + Name string + } + Previous struct { + ResourceURI string + Name string + } + } + } }, err error) { u := c.baseURL(req) u.Path += fmt.Sprintf("series/%d/comics", id)