Closed zhouzi closed 7 years ago
It's intended and documented.
faction, group, href, name, uuid, and variations are guaranteed to be part of the object, the rest are optional.
I don't think there's a strong semantic reason to make an empty array, I think it communicate the same intention if it's missing entirely.
If there's not a strong semantic reason I leave out the field since it would otherwise use memory and consume a tiny bit more bandwidth to create the object for 0 benefit.
This is, of course, up for discussion.
Having default empty values makes it easier to consume as you can loop over the cards and treat them all the same. But it's no big deal and I'm fine with it 👍
That may be intentional but some cards doesn't have certain properties. For example, Alba Spearmen doesn't have
categories
although Adrenaline Rush does.I'd suggest to set it to an empty array instead of removing it.