add user management functionality with OTP verification and consent handling, DI introduced
This commit is contained in:
@ -5,35 +5,11 @@ info:
|
||||
servers:
|
||||
- url: https://api.example.com/v1
|
||||
paths:
|
||||
/users:
|
||||
get:
|
||||
summary: Get all users
|
||||
responses:
|
||||
'200':
|
||||
description: A list of users
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/User'
|
||||
post:
|
||||
summary: Create a new user
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserCreate'
|
||||
responses:
|
||||
'201':
|
||||
description: User created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/User'
|
||||
/users/{userId}:
|
||||
get:
|
||||
tags:
|
||||
- users
|
||||
operationId: getUserById
|
||||
summary: Get a user by ID
|
||||
parameters:
|
||||
- name: userId
|
||||
@ -47,92 +23,65 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/User'
|
||||
type: object
|
||||
properties:
|
||||
user:
|
||||
$ref: '#/components/schemas/User'
|
||||
required:
|
||||
- user
|
||||
|
||||
|
||||
|
||||
'404':
|
||||
description: User not found
|
||||
put:
|
||||
summary: Update a user by ID
|
||||
parameters:
|
||||
- name: userId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
example: "User not found"
|
||||
required:
|
||||
- message
|
||||
/users:
|
||||
post:
|
||||
tags:
|
||||
- users
|
||||
operationId: createUser
|
||||
summary: "Create a new user with phone number"
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserUpdate'
|
||||
$ref: '#/components/schemas/UserCreate'
|
||||
responses:
|
||||
'200':
|
||||
description: User updated
|
||||
description: User created successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/User'
|
||||
'404':
|
||||
description: User not found
|
||||
delete:
|
||||
summary: Delete a user by ID
|
||||
parameters:
|
||||
- name: userId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'204':
|
||||
description: User deleted successfully
|
||||
'404':
|
||||
description: User not found
|
||||
|
||||
components:
|
||||
schemas:
|
||||
User:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
uuid:
|
||||
type: string
|
||||
example: "123"
|
||||
username:
|
||||
phone_number:
|
||||
type: string
|
||||
example: "johndoe"
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
example: "johndoe@example.com"
|
||||
required:
|
||||
- id
|
||||
- username
|
||||
- email
|
||||
- uuid
|
||||
- phone_number
|
||||
UserCreate:
|
||||
type: object
|
||||
properties:
|
||||
username:
|
||||
phone_number:
|
||||
type: string
|
||||
example: "johndoe"
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
example: "johndoe@example.com"
|
||||
password:
|
||||
type: string
|
||||
format: password
|
||||
|
||||
required:
|
||||
- username
|
||||
- email
|
||||
- password
|
||||
UserUpdate:
|
||||
type: object
|
||||
properties:
|
||||
username:
|
||||
type: string
|
||||
example: "john_doe_updated"
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
example: "johnupdated@example.com"
|
||||
required:
|
||||
- username
|
||||
- email
|
||||
- phone_number
|
||||
|
||||
Reference in New Issue
Block a user