api icon indicating copy to clipboard operation
api copied to clipboard

[FEATURE]: Update Helldivers.Models.V1.Assignment to allow for more than one reward

Open raginmari opened this issue 1 year ago • 4 comments

What problem does it solve

Arrowhead's API has an array called "rewards" in their assignment type (on the same level as the known "reward" object) which allows for more than just one reward for an assignment.

"rewards": [
    {
        "type": 1,
        "id32": 897894480,
        "amount": 45
    },
    {
        "type": 1,
        "id32": 3608481516,
        "amount": 29000
    }
],
"reward": {
    "type": 1,
    "id32": 897894480,
    "amount": 45
},

What is the solution

Two options:

  • A non breaking change adds a List<Helldivers.Models.V1.Reward> Rewards to the Helldivers.Models.V1.Assignment in addition to the existing Reward property. The Reward is deprecated.
  • A breaking change replaces the existing Reward with a List<Helldivers.Models.V1.Reward> Rewards.

Existing alternatives

Clients use the raw API to get assignment information (see JSON sample above).

Added value

Clients receive all rewards and can use / display them correctly.

Additional notes

None.

raginmari avatar Aug 17 '24 23:08 raginmari

I feel like in this case the breaking change is the way to go, mainly because it's the way AH does it and we want to maintain similarity between the API's

@chatterchats thoughts?

dealloc avatar Aug 18 '24 20:08 dealloc

How would a breaking change be implemented so that existing projects like the "War Monitor" app keep working? Would have be a "v2" of the API, right (I'm doing mobile frontend mostly, so I don't have much experience with API development)?

raginmari avatar Aug 18 '24 22:08 raginmari

I feel like in this case the breaking change is the way to go, mainly because it's the way AH does it and we want to maintain similarity between the API's

@chatterchats thoughts?

I mean, I'll be honest, mine is kinda already doing it 👀 but mines a lot simpler than yours and acts more as a relay w/ no data validation (explicitly because AH kept/keeps changing their stuff)

It's only a breaking change because AH made a breaking change for anyone who isn't using data validation against what they fetched - like me >.> - My thought is most people are pulling it down into their language's version of a Dict, and just doing something like assignment["setting"]["reward"] but that may just be my laziness coming through

image

chatterchats avatar Aug 18 '24 22:08 chatterchats

I too would like this ASAP :)

Stonemercy avatar Oct 04 '24 13:10 Stonemercy