discord-api-spec icon indicating copy to clipboard operation
discord-api-spec copied to clipboard

Missing enum values in spec

Open Bluenix2 opened this issue 8 months ago • 3 comments

There are several enums across the spec which are missing values, this either results in the specification falsely allowing any integer values, or an enum with no valid value. In the case of me trying to use code generation, it resulted in an invalid Python Literal.

  • ApplicationCommandHandler
  • EntitlementOwnerTypes
  • NameplatePalette
  • PollLayoutTypes
  • ThreadSearchTagSetting

Of course I can special-case this to automatically use the default, but this would be incorrect behaviour.

Bluenix2 avatar Mar 28 '25 13:03 Bluenix2

Thanks for the report, we'll take a look

yonilerner avatar Mar 31 '25 23:03 yonilerner

Hi, I wanted to share some thoughts regarding this issue. I've found values for most of the enums in the Discord API documentation and created a corresponding JSON schema for them. To generate a complete schema of the API, I use a merge tool to combine individual schema definitions—perhaps that could be useful for you as well.

One enum I couldn't find any official information on is ThreadSearchTagSetting. It appears to be unused in the current Discord API. I looked for an endpoint using it, specifically /channels/{channel_id}/threads/search with the tag_setting query parameter, but this parameter isn't listed in the documentation. It does exist in the Postman collection, but even there, tag_setting is missing. It’s possible that this endpoint has been changed or deprecated.

I'd really appreciate it if this issue could be updated, as it would help keep the schema in sync with the latest API changes.

Here’s a snippet of the schema I’ve built so far:

{
  "ApplicationCommandHandler": {
    "type": "integer",
    "oneOf": [
      {
        "title": "APP_HANDLER",
        "description": "The app handles the interaction using an interaction token",
        "const": 1
      },
      {
        "title": "DISCORD_LAUNCH_ACTIVITY",
        "description": "Discord handles the interaction by launching an Activity and sending a follow-up message without coordinating with the app",
        "const": 2
      }
    ],
    "format": "int32"
  },
  "EntitlementOwnerTypes": {
    "type": "integer",
    "oneOf": [
      {
        "title": "GUILD",
        "description": "Guild subscription",
        "const": 1
      },
      {
        "title": "USER",
        "description": "User subscription",
        "const": 2
      }
    ],
    "format": "int32"
  },
  "NameplatePalette": {
    "type": "string",
    "oneOf": [
      {
        "title": "CRIMSON",
        "const": "crimson"
      },
      {
        "title": "BERRY",
        "const": "berry"
      },
      {
        "title": "SKY",
        "const": "sky"
      },
      {
        "title": "TEAL",
        "const": "teal"
      },
      {
        "title": "FOREST",
        "const": "forest"
      },
      {
        "title": "BUBBLE_GUM",
        "const": "bubble_gum"
      },
      {
        "title": "VIOLET",
        "const": "violet"
      },
      {
        "title": "COBALT",
        "const": "cobalt"
      },
      {
        "title": "CLOVER",
        "const": "clover"
      },
      {
        "title": "LEMON",
        "const": "lemon"
      },
      {
        "title": "WHITE",
        "const": "white"
      }
    ]
  },
  "PollLayoutTypes": {
    "type": "integer",
    "oneOf": [
      {
        "title": "DEFAULT",
        "description": "The, uhm, default layout type.",
        "const": 1
      }
    ],
    "format": "int32"
  }
}

201st-Luka avatar Jul 22 '25 19:07 201st-Luka

@201st-Luka thanks for flagging the missing ThreadSearchTagSetting values! we've added that to the spec in https://github.com/discord/discord-api-spec/commit/bbb2467dc452737b25550a38e8df0ca1be788fb4

the endpoint is already in the spec and it will be documented soon.

advaith1 avatar Jul 24 '25 20:07 advaith1