From 161553a84fb0b7cfc80b20a466fa76fb22c49473 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Tue, 11 Jul 2023 17:15:49 +0200 Subject: [PATCH] updated yaml file --- misc/index.yaml | 62 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/misc/index.yaml b/misc/index.yaml index accd984..c08e978 100644 --- a/misc/index.yaml +++ b/misc/index.yaml @@ -18,7 +18,32 @@ servers: description: "Test server self-hosted by yours truly" paths: - # tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step4_paths_object.html + # tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step4_paths_object.html + /login: + post: + summary: Returns a JWT session token and user data if successful + requestBody: + description: Login credentials + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/credentials' + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/login_result' + 400: + $ref: '#/components/responses/400' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + 503: + $ref: '#/components/responses/503' /shipcalls: get: @@ -108,8 +133,8 @@ paths: parameters: - name: user_id in: query - required: false - description: "**Id of user**. *Example: 2*. User id returned by login call. No parameter returns all participants." + required: true + description: "**Id of user**. *Example: 2*. User id returned by verify call." schema: type: integer responses: @@ -260,6 +285,16 @@ paths: $ref: '#/components/responses/503' components: schemas: + credentials: + type: object + required: + - username + - password + properties: + username: + format : string + password: + format : string timesId: description: The unique identifier for a times entry type: integer @@ -412,6 +447,27 @@ components: city: type: string + login_result: + type: object + description: result structure of a successful login attempt + properties: + id: + type: integer + participant_id: + type: integer + first_name: + type: string + last_name: + type: string + user_name: + type: string + user_phone: + type: string + exp: + type: float + token: + type: string + Error: type: object required: