From 599cd689f6a81c2082e3aed954839c937c3fa88b Mon Sep 17 00:00:00 2001 From: akhdanre Date: Fri, 21 Mar 2025 01:20:32 +0700 Subject: [PATCH] feat: adding documentation for user --- .vscode/settings.json | 5 +++++ app/configs/config.py | 1 + docs/rest_api_docs.yaml | 50 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..26e7cad --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "yaml.schemas": { + "openapi:v3": "file:///mnt/disc1/code/thesis_quiz_project/quiz_maker/docs/rest_api_docs.yaml" + } +} \ No newline at end of file diff --git a/app/configs/config.py b/app/configs/config.py index 499742d..e27acc7 100644 --- a/app/configs/config.py +++ b/app/configs/config.py @@ -8,6 +8,7 @@ load_dotenv(override=True) class Config: FLASK_ENV = os.getenv("FLASK_ENV", "development") DEBUG = os.getenv("DEBUG", "False").lower() in ("true", "1", "t") + API_VERSION = os.getenv("API_VERSION", "v1") SECRET_KEY = os.getenv("SECRET_KEY", "your_secret_key") MONGO_URI = os.getenv("MONGO_URI", "mongodb://localhost:27017/yourdb") diff --git a/docs/rest_api_docs.yaml b/docs/rest_api_docs.yaml index 45d0e54..032c653 100644 --- a/docs/rest_api_docs.yaml +++ b/docs/rest_api_docs.yaml @@ -161,3 +161,53 @@ paths: message: type: string example: "Email already registered" + /user: + get: + summary: Get User + description: Get user data + tags: + - User + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: integer + example: 1 + name: + type: string + example: "Oukenze" + email: + type: string + example: "oukenzeumasio" + put: + summary: Update User + description: Update user data + tags: + - User + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + email: + type: string + example: "" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: "User updated successfully" +