twitchdev/twitch-cli

[Bug] Possible mismatch in PATCH /mock/entitlements/drops response

Closed this issue · 0 comments

What is the problem?

I have encountered a strange situation while using mock-api server in order to test Drops.
In particular I noticed a mismatch between the response in the official documentation: https://dev.twitch.tv/docs/api/reference/#update-drops-entitlements and the response I'm getting from the mock server. Below you can see both:

Official documentation

{
  "data": [
    {
      "status": "SUCCESS",
      "ids": [
        "fb78259e-fb81-4d1b-8333-34a06ffc24c0", "862750a5-265e-4ab6-9f0a-c64df3d54dd0"
      ]
    },
    {
      "status": "UNAUTHORIZED",
      "ids": [
        "d8879baa-3966-4d10-8856-15fdd62cce02"
      ]
    },
    {
      "status": "UPDATE_FAILED",
      "ids": [
        "9a290126-7e3b-4f66-a9ae-551537893b65"
      ]
    }
  ]
}

Mock API

[
  {
    "status": "SUCCESS",
    "ids": [
      "bedd1eff-dd39-b5a5-3a5e-945eaa6bea22"
    ]
  }
]

You can notice that in the mock-api there is no "data" property.

Since I don't know which is the real response, and so if the source of truth is the documentation or the mock-api response, I'm not sure this is a proper bug.
In case this is actually a bug, I already have a fix ready for a new PR, but before submitting it I preferred to discuss if it is needed.

Thank you.

Operating System

linux, macOS, windows

Architecture Version (x86, x64, arm, etc)

x86, x64, arm

Steps to reproduce

  1. Start the mock server
  2. Call the endpoint: PATCH /mock/entitlements/drops and check the response, which is different from the one in the official documentation

Relevant log output

No response