discord/discord-api-spec

Incorrect `type` for `default_member_permissions` JSON parameter when updating global application commands

A5rocks opened this issue · 3 comments

The specification says the default_member_permissions JSON parameter for updating global application commands is ?integer:

"default_member_permissions": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 281474976710655
},

The documentation says the same field should be a ?string.

Our API accepts ints in string fields and strings in int fields (as long as they can be parsed as ints). This is a flag field so I think it makes sense to spec it out as an int (e.g. we can provide max value). Building a better support for flag fields in the spec is on our backlog.

... should the "type" maybe be ["integer", "string", "null"] then? With a "pattern" to make sure the string is a number.

we could type every int field like this which feels counter-productive