api icon indicating copy to clipboard operation
api copied to clipboard

Inconsistency API response

Open RezkyRizaldi opened this issue 2 years ago • 4 comments

When you request to /characters/amber, the response contains

{
  ...
  gender: "Female",
  specialDish: "Outrider's Champion Steak!",
  ...
}

which in the other request it doesn't exists.

And in some endpoints e.g. /characters/keqing or /characters/jean the response contain

{
  outfits: [
    {
      ...
    }
  ]
}

which in the other request isn't present.

And other things like:

  • nation key in /characters/aloy has 'Unknown' string value
  • birthday key in /characters/traveler(s) is missing
  • affilation key in /characters/traveler(s) has 'Not affilated to any Nation' string value

Is it better that if the missing key should be nullable instead of undefined or having an empty string?

RezkyRizaldi avatar Nov 16 '22 08:11 RezkyRizaldi

I'll look into it! :+1:

arktn avatar Dec 05 '22 09:12 arktn

* `affilation` key in `/characters/traveler`(s) has `'Not affilated to any Nation'` string value

Is it better that if the missing key should be nullable instead of undefined or having an empty string?

These API responses are made for clarity, for example "Not affiliated to any Nation" is still information about the character returning a null-able value here could mean that the affiliation is not known or hasn't been added yet or that there is none so the current output provides more clarity.

arktn avatar Dec 07 '22 10:12 arktn

* `affilation` key in `/characters/traveler`(s) has `'Not affilated to any Nation'` string value

Is it better that if the missing key should be nullable instead of undefined or having an empty string?

These API responses are made for clarity, for example "Not affiliated to any Nation" is still information about the character returning a null-able value here could mean that the affiliation is not known or hasn't been added yet or that there is none so the current output provides more clarity.

I think it's better to make a new key-value for example affiliated with a boolean value or something that can be processed and consumed flexibly.

But it will make a breaking changes for the stucture.

RezkyRizaldi avatar Dec 07 '22 19:12 RezkyRizaldi

hello, I am debanjan mukherjee ,I would like to change the api and can make it more responsive .I have some projects on that .If you assign me I can do that.

RickDeb2004 avatar Apr 05 '23 18:04 RickDeb2004