From d85181e031445dc94f6e1b0abb59f2352c95578f Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 15 Dec 2020 13:56:07 -0500 Subject: [PATCH] feat: add schema for api ping routes --- public/openapi/write/ping.yaml | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 public/openapi/write/ping.yaml diff --git a/public/openapi/write/ping.yaml b/public/openapi/write/ping.yaml new file mode 100644 index 0000000000..8e2b0c7540 --- /dev/null +++ b/public/openapi/write/ping.yaml @@ -0,0 +1,56 @@ +get: + tags: + - utilities + summary: test route + description: This route responds with a simple `200 OK` if the Write API is enabled. Since there is no way of disabling the Write API, this will always return a success. However, it is also a good way to ensure the instance you are calling supports v3 of the Write API. + responses: + '200': + description: pingback + content: + application/json: + schema: + type: object + properties: + status: + $ref: ../components/schemas/Status.yaml#/Status + response: + type: object + properties: + pong: + type: boolean + example: true +post: + tags: + - utilities + summary: test route + description: | + Requires authentication. This route bounces back the data payload sent to it, and the uid the token resolved to. + + It is also a good way to ensure the instance you are calling supports v3 of the Write API. Also, as it requires authentication, it is a good way to check if the passed-in token is a valid token. + requestBody: + required: false + content: + application/json: + schema: + type: object + additionalProperties: {} + responses: + '200': + description: pingback + content: + application/json: + schema: + type: object + properties: + status: + $ref: ../components/schemas/Status.yaml#/Status + response: + type: object + properties: + uid: + type: number + description: The `uid` that the passed-in token resolves to. + received: + type: object + description: A free-form object containing the data that was passed to it. It reflects the data payload as the Write API understands it, and it may be useful to call this route to see how a request body is parsed, if at all. + additionalProperties: {} \ No newline at end of file