mirror of
https://github.com/discord/discord-api-spec.git
synced 2024-12-22 00:21:23 -05:00
Compare commits
2 commits
6aca69a688
...
515b793b5d
Author | SHA1 | Date | |
---|---|---|---|
|
515b793b5d | ||
|
f9906d0c51 |
3 changed files with 35 additions and 344 deletions
13
README.md
13
README.md
|
@ -22,3 +22,16 @@ To use the spec with Postman, you can view the [public collection](https://www.p
|
|||
OpenAPI spec contents are automatically generated, and therefore **we do not allow public contributions to this repo**.
|
||||
|
||||
🐛 For bug fixes or improvements, you can [open an issue](https://github.com/discord/discord-api-spec/issues).
|
||||
|
||||
## Spec conventions
|
||||
- This is a preview and it may be not correct. If you find discrepancies between the spec and our [docs](https://discord.com/developers/docs), other than the ones mentioned below, let us know, and follow the docs, not the spec.
|
||||
- Even though we define `anyOf` and `oneOf` unions, they all mean that only one type from the list can be used as a data format. E.g. `anyOf: {'Cat', 'Dog'}`, still means that you can either pass `Cat` or `Dog`, not `Cat+Dog`. This is signified by the custom extension `x-discord-union: oneOf`. We use `anyOf` when we technically can’t use `oneOf`. One of the reasons to do that is e.g. when all the fields are optional and the passed in data could be validated with more than one format.
|
||||
- We avoid over-specifying response fields and merely define field types, like `int32`, and we avoid defining specific minimums, maximums, etc.
|
||||
- Some fields typed as strings in our docs may be typed as ints in the spec. Our API accepts strings for int fields if they are parseable as ints. We think it’ll be more precise to spec these int-parseable strings as ints.
|
||||
|
||||
## Known issues
|
||||
- (almost) All nullable fields are additionally marked as optional and all optional fields are additionally marked as nullable.
|
||||
- Operations and fields don’t have descriptions.
|
||||
- Operations don’t have tags.
|
||||
- Flag fields don’t detail specific flag values and their meaning.
|
||||
- Optional query args are typed as nullable, even though it doesn’t make much sense.
|
|
@ -29,7 +29,7 @@
|
|||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/GetMyOAuth2ApplicationResponse"
|
||||
"$ref": "#/components/schemas/PrivateApplicationResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15759,177 +15759,6 @@
|
|||
"url"
|
||||
]
|
||||
},
|
||||
"GetMyOAuth2ApplicationResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "snowflake"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ApplicationTypes"
|
||||
}
|
||||
]
|
||||
},
|
||||
"cover_image": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"primary_sku_id": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "snowflake"
|
||||
},
|
||||
"bot": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/UserResponse"
|
||||
}
|
||||
]
|
||||
},
|
||||
"slug": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"guild_id": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "snowflake"
|
||||
},
|
||||
"rpc_origins": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"bot_public": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"bot_require_code_grant": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"terms_of_service_url": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "uri"
|
||||
},
|
||||
"privacy_policy_url": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "uri"
|
||||
},
|
||||
"custom_install_url": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "uri"
|
||||
},
|
||||
"install_params": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ApplicationOAuth2ParamsResponse"
|
||||
}
|
||||
]
|
||||
},
|
||||
"verify_key": {
|
||||
"type": "string"
|
||||
},
|
||||
"flags": {
|
||||
"type": "integer",
|
||||
"minimum": -2147483648,
|
||||
"maximum": 2147483647,
|
||||
"format": "int32"
|
||||
},
|
||||
"max_participants": {
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"minimum": -2147483648,
|
||||
"maximum": 2147483647,
|
||||
"format": "int32"
|
||||
},
|
||||
"tags": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"owner": {
|
||||
"$ref": "#/components/schemas/UserResponse"
|
||||
},
|
||||
"team": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/TeamResponse"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"description",
|
||||
"verify_key",
|
||||
"flags",
|
||||
"owner"
|
||||
]
|
||||
},
|
||||
"GithubAuthor": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -24151,6 +23980,16 @@
|
|||
"minimum": -2147483648,
|
||||
"maximum": 2147483647,
|
||||
"format": "int32"
|
||||
},
|
||||
"team": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/TeamResponse"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/GetMyOAuth2ApplicationResponse"
|
||||
"$ref": "#/components/schemas/PrivateApplicationResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15763,177 +15763,6 @@
|
|||
"url"
|
||||
]
|
||||
},
|
||||
"GetMyOAuth2ApplicationResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "snowflake"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ApplicationTypes"
|
||||
}
|
||||
]
|
||||
},
|
||||
"cover_image": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"primary_sku_id": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "snowflake"
|
||||
},
|
||||
"bot": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/UserResponse"
|
||||
}
|
||||
]
|
||||
},
|
||||
"slug": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"guild_id": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "snowflake"
|
||||
},
|
||||
"rpc_origins": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"bot_public": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"bot_require_code_grant": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"terms_of_service_url": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "uri"
|
||||
},
|
||||
"privacy_policy_url": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "uri"
|
||||
},
|
||||
"custom_install_url": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "uri"
|
||||
},
|
||||
"install_params": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ApplicationOAuth2ParamsResponse"
|
||||
}
|
||||
]
|
||||
},
|
||||
"verify_key": {
|
||||
"type": "string"
|
||||
},
|
||||
"flags": {
|
||||
"type": "integer",
|
||||
"minimum": -2147483648,
|
||||
"maximum": 2147483647,
|
||||
"format": "int32"
|
||||
},
|
||||
"max_participants": {
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"minimum": -2147483648,
|
||||
"maximum": 2147483647,
|
||||
"format": "int32"
|
||||
},
|
||||
"tags": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"owner": {
|
||||
"$ref": "#/components/schemas/UserResponse"
|
||||
},
|
||||
"team": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/TeamResponse"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"description",
|
||||
"verify_key",
|
||||
"flags",
|
||||
"owner"
|
||||
]
|
||||
},
|
||||
"GithubAuthor": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -24161,6 +23990,16 @@
|
|||
"minimum": -2147483648,
|
||||
"maximum": 2147483647,
|
||||
"format": "int32"
|
||||
},
|
||||
"team": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/TeamResponse"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
Loading…
Reference in a new issue