helldivers-2 / api

A community driven API for Helldivers 2
https://helldivers-2.github.io/api/
MIT License
220 stars 19 forks source link

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

Open raginmari opened 2 months ago

raginmari commented 2 months ago

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:

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.

dealloc commented 2 months ago

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?

raginmari commented 2 months ago

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)?

chatterchats commented 2 months ago

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

Stonemercy commented 1 month ago

I too would like this ASAP :)