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

Color values are invalid

Open jaw0r3k opened this issue 1 year ago • 2 comments

https://github.com/discord/discord-api-spec/blob/4649f52a83726fe78745cd3ac8e891f54ce1df86/specs/openapi.json#L26868-L26876

As we know colors can be from 0 to #FFFFFF So definetly not the whole int32

The same with other properties like position which cant be negative

Code

https://github.com/discord/discord-api-spec/blob/4649f52a83726fe78745cd3ac8e891f54ce1df86/specs/openapi.json#L27704-L27709

jaw0r3k avatar Aug 03 '23 15:08 jaw0r3k

This just means the value fits within int32 type, which is valid. I understand it may look weird for a couple of specific fields, but we didn't want to narrow down response field types too much in general. Over time we may decide to add more specialized response field types.

mbialecka avatar Aug 03 '23 17:08 mbialecka

What about colours with an alpha (transparency) component? You'd need those unused 16 bits then! :stuck_out_tongue_winking_eye:

SlySven avatar Aug 06 '23 02:08 SlySven