OPSkins / trade-opskins-api

API docs for trade.opskins.com
41 stars 19 forks source link

/IItem/GetItems/v1/ invalid response #28

Closed ha1331 closed 2 years ago

ha1331 commented 6 years ago

According to the documentation the route should have a following signture:

items: {
  "<sku>": {
    "<wear_tier_index>": {  ... },
    "<wear_tier_index>": {  ... },
  }
}

This is not the case tho. If you look at sku "1" the value is not an object. For some reason it's an array with a single object, namely skeleton key.

I don't know why this is, but it's not following the documentation you have provided.

for a fairly compact api, there seem to be a lot of these, let's call them creative implementation details and it kind of worries me. Should I implement religious level type checking to consume this api comfortably, or are these just bugs? I don't mean to sound salty or anything, I will gladly do so if this is the direction you're taking going forward. Would just like to know if I'm supposed to treat this as being in "beta" or "subject to change".

rannmann commented 6 years ago

If a change, including a bugfix, would break any compatibility for an API endpoint we will bump the version number in order to fix it. That doesn't mean all API output is going to be identical to what it is now. If we add a property to an object, that shouldn't break anyone's code. If we remove a property or change the format of the output, then we'll update the version.

This is a bug related to PHP internals. We will fix it, but since it's a breaking change it will be introduced as GetItems/v2. :(

ha1331 commented 6 years ago

@rannmann makes sense. I don't think this is a major issues anyways. I would suggest you mention this edge case in the docs tho.

rannmann commented 6 years ago

Added in 5b351929ac