openapi: 3.0.1 info: title: API V1 version: v1 servers: - url: http://localhost:3000 components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT paths: '/users': post: summary: User sign up tags: - Users requestBody: required: true content: application/json: schema: type: object properties: user: type: object properties: name: type: string email: type: string password: type: string required: - name - email - password responses: '201': description: User signed up successfully '400': description: Bad Request - Invalid request '/users/sign_in': post: summary: User sign in tags: - Users/sign_in requestBody: required: true content: application/json: schema: type: object properties: user: type: object properties: email: type: string password: type: string required: - email - password responses: '200': description: User signed in successfully '401': description: Unauthorized - Invalid credentials '400': description: Bad Request - Invalid request '/users/sign_out': delete: summary: User sign out tags: - Users/sign_out security: - BearerAuth: [] # Indicate that bearer token is required for this endpoint responses: '200': description: User signed out successfully '401': description: Unauthorized - Invalid or missing authentication token '/api/v1/doctors': get: summary: List doctors tags: - Doctors responses: '200': description: Successful retrieval of doctors post: summary: Create a doctor tags: - Doctors security: - BearerAuth: [] # Indicate that bearer token is required for this endpoint requestBody: required: true content: application/json: schema: type: object properties: doctor: type: object properties: doc_name: type: string education: type: string bio: type: string years_of_experience: type: integer required: - doc_name responses: '201': description: Doctor created successfully '400': description: Bad Request - Invalid request '/api/v1/appointments': get: summary: List appointments tags: - Appointments responses: '200': description: Successful retrieval of appointments post: summary: Create an appointment tags: - Appointments security: - BearerAuth: [] # Indicate that bearer token is required for this endpoint requestBody: required: true content: application/json: schema: type: object properties: appointment: type: object properties: user_id: type: integer doctor_id: type: integer appointment_date: type: string appointment_time: type: string location: type: string required: - user_id - doctor_id - appointment_date - appointment_time responses: '201': description: Appointment created successfully '400': description: Bad Request - Invalid request '/api/v1/appointments/{id}': parameters: - name: id in: path description: ID of the appointment to be updated or deleted required: true schema: type: integer put: summary: Update an appointment tags: - Appointments security: - BearerAuth: [] # Indicate that bearer token is required for this endpoint requestBody: required: true content: application/json: schema: type: object properties: appointment: type: object properties: user_id: type: integer doctor_id: type: integer appointment_date: type: string appointment_time: type: string location: type: string required: - user_id - doctor_id - appointment_date - appointment_time responses: '200': description: Appointment updated successfully '400': description: Bad Request - Invalid request '401': description: Unauthorized - Invalid or missing authentication token '404': description: Not Found - Appointment not found delete: summary: Delete an appointment tags: - Appointments security: - BearerAuth: [] # Indicate that bearer token is required for this endpoint responses: '204': description: Appointment deleted successfully '401': description: Unauthorized - Invalid or missing authentication token '404': description: Not Found - Appointment not found