Hearthstone

FREE
By omgvamp | Updated 12 days ago | Entertainment
Popularity

9.7 / 10

Latency

2,227ms

Service Level

99%

Health Check

N/A

Back to All Discussions

All Cards Without Set

Rapid account: Vkapadia
vkapadia
8 years ago

Is it possible to have an endpoint or option that would return all cards (filterable by Collectible, of course) that’s not separated by set?

Rapid account: Strican
strican Commented 7 years ago

I agree with OP. It’s totally doable on the client side, but the documentation suggests that the /cards endpoint returns a flat list of cards, each of which has a field for the card set anyway. If anything, the API should return a list of {set, cards} objects so that consumers can provide strict type definitions. As it is, each new set requires a new field definition since the set name is being used as the property name. Does that make sense?

Rapid account: Jim Moyle
JimMoyle Commented 8 years ago

Get all cards, iterate available sets, loop through sets and create a new list, should be fairly easy client side.

Rapid account: Vkapadia
vkapadia Commented 8 years ago

I’m not sure if there is another way to do it or not (I’m pretty new to this). My issue is that right now I have a class that I deserialize the JSON into. The class contains “IList<Card> Basic” and “IList<Card> Classic” and “IList<Card> Naxxramas” and so on. Basically I have a new IList for each set. This is not a huge problem now, but the issue is that when the set list changes (new sets are added), I have to update the app to accommodate it, or else I don’t get the new cards.

Rapid account: Omgvamp
omgvamp Commented 8 years ago

Could you explain the benefit of this versus looping through it on your end?

Join in the discussion - add comment below:

Login / Signup to post new comments