From 5cc7afe71c3f635af70737c9d9f597c2f8c7052d Mon Sep 17 00:00:00 2001 From: Adversary Date: Tue, 8 Aug 2023 18:10:02 +0000 Subject: [PATCH] main - remote-2023-08-08T17:22:21 now-2023-08-08T18:10:02 --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index fb9443a..76fdcaf 100644 --- a/README.md +++ b/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. \ No newline at end of file