-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Problem:
In the Gamer Loot response payload, it returns a "streams" object with repeating objects (i.e. loot_season_1, loot_season_2, etc).
{
"status": "success",
"data": {
"streams": {
"loot_season_1": {
"name": "loot_season_1",
"categoryNameLabel": "Season 1",
"categoryTitleLabel": "Season 1",
"tier": 0,
"streamType": "season",
"rarity": null,
"lootType": null,
"seasonInfoUrlKey": "season-1",
"itemsObtained": null,
"premiumTokenOwnedNotRedeemed": false,
"tierSkipTokensUnredeemed": null,
"premium": false
},
"loot_season_0": {
"name": "loot_season_0",
"categoryNameLabel": "Season 0",
"categoryTitleLabel": "Season 0",
"tier": 0,
"streamType": "season",
"rarity": null,
"lootType": null,
"seasonInfoUrlKey": "season-0",
"itemsObtained": null,
"premiumTokenOwnedNotRedeemed": false,
"tierSkipTokensUnredeemed": null,
"premium": false
}
}
}
}
Find a way using go-swagger to autogenerate and represent the streams field as type map[string]SomeStruct
Sample
type SomeStruct struct {
Name string
CategoryNameLabel string
CategoryTitleLabel string
...
}
someStruct := streams["loot_season_1"]
someStruct.CategoryNameLabel
Metadata
Metadata
Assignees
Labels
No labels