How can i define same endpoint with different roles in swaggerhub api documentation.
/register:
post:
summary: Creates a new Driver.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/User'
responses:
200:
description: OK
201:
description: 'User created successfully.'
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: true
code:
type: integer
example: 201
message:
type: string
example: User Registered Successfully.
data:
type: object
properties:
user_id:
type: integer
name:
type: string
full_name:
type: string
email:
type: string
mobile_number:
type: string
is_verified:
type: boolean
is_active:
type: boolean
components:
schemas:
User:
properties:
mobile_number:
type: string
email:
type: string
gender:
type: string
enum: ['male','female','others']
password:
type: string
full_name:
type: string
role_id:
type: integer
vehicle_type:
type: string
enum: ['Bike','Car','Bicycle','Other']
# All properties are required
required:
- mobile_number
- gender
- full_name
- role_id
- password
- vehicle_type
Now, is there any way to use same endpoint for different role_id. so i can use same resource with other validation fields. i want to user same register resource for different-different roles.
Anyone has an idea about this?