discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.95k stars 1.26k forks source link

Using Create Guild Sticker endpoint with `payload_json` results in inconsistent behavior #5550

Closed TTtie closed 2 years ago

TTtie commented 2 years ago

Description

Using payload_json with the Create Guild Sticker endpoint (seemingly implemented in #3969) results in unexpected and inconsistent behavior contrary to other endpoints using payload_json in the API.

Steps to Reproduce

  1. Send the following request
    curl --trace-ascii - -s -H"Authorization: Bot $BOT_TOKEN" \
        -F"file=@file.png" \
        -F'payload_json={"name": "testing","description": "testing sticker","tags": "tag"};type=application/json' \
        https://discord.com/api/v10/guilds/$GUILD_ID/stickers
  2. Send the following request
    curl --trace-ascii - -s -H"Authorization: Bot $BOT_TOKEN" \
        -F"name=test" \
        -F"description=desc" \
        -F"tags=tags" \
        -F"file=@file.png" \
        -F'payload_json={};type=application/json' \
        https://discord.com/api/v10/guilds/$GUILD_ID/stickers
  3. Send the following request
    curl --trace-ascii - -s -H"Authorization: Bot $BOT_TOKEN" \
        -F"name=test" \
        -F"description=desc" \
        -F"tags=tags" \
        -F"file=@file.png" \
        -F'payload_json={"name": "testing","description": "testing sticker","tags": "tag"};type=application/json' \
        https://discord.com/api/v10/guilds/$GUILD_ID/stickers

Expected Behavior

Current Behavior

Screenshots/Videos

No response

Client and System Information

Discord API v9/v10, any client (tested with curl 7.82.0)

DV8FromTheWorld commented 2 years ago

Confirmed that there is a bug here.

Thank you for the test cases. I'll update this once the fix is merged and deployed!

DV8FromTheWorld commented 2 years ago

A fix for this has been merged and will be available in the API following deployments.

DV8FromTheWorld commented 2 years ago

This is deployed