openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: students description: Student management - name: teachers description: Teacher management - name: classes description: Class management paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /students: get: operationId: listStudents tags: [students] summary: List all students parameters: - in: query name: search schema: type: string - in: query name: className schema: type: string - in: query name: section schema: type: string responses: "200": description: List of students content: application/json: schema: type: array items: $ref: "#/components/schemas/Student" post: operationId: createStudent tags: [students] summary: Create a student requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateStudentInput" responses: "201": description: Created student content: application/json: schema: $ref: "#/components/schemas/Student" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /students/{id}: get: operationId: getStudent tags: [students] summary: Get student by ID parameters: - in: path name: id required: true schema: type: string responses: "200": description: Student found content: application/json: schema: $ref: "#/components/schemas/Student" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" put: operationId: updateStudent tags: [students] summary: Update a student parameters: - in: path name: id required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateStudentInput" responses: "200": description: Updated student content: application/json: schema: $ref: "#/components/schemas/Student" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" delete: operationId: deleteStudent tags: [students] summary: Delete a student parameters: - in: path name: id required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /teachers: get: operationId: listTeachers tags: [teachers] summary: List all teachers parameters: - in: query name: search schema: type: string responses: "200": description: List of teachers content: application/json: schema: type: array items: $ref: "#/components/schemas/Teacher" post: operationId: createTeacher tags: [teachers] summary: Create a teacher requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateTeacherInput" responses: "201": description: Created teacher content: application/json: schema: $ref: "#/components/schemas/Teacher" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /teachers/{id}: get: operationId: getTeacher tags: [teachers] summary: Get teacher by ID parameters: - in: path name: id required: true schema: type: string responses: "200": description: Teacher found content: application/json: schema: $ref: "#/components/schemas/Teacher" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" put: operationId: updateTeacher tags: [teachers] summary: Update a teacher parameters: - in: path name: id required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateTeacherInput" responses: "200": description: Updated teacher content: application/json: schema: $ref: "#/components/schemas/Teacher" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" delete: operationId: deleteTeacher tags: [teachers] summary: Delete a teacher parameters: - in: path name: id required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /classes: get: operationId: listClasses tags: [classes] summary: List all classes responses: "200": description: List of classes content: application/json: schema: type: array items: $ref: "#/components/schemas/SchoolClass" post: operationId: createClass tags: [classes] summary: Create a class requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateClassInput" responses: "201": description: Created class content: application/json: schema: $ref: "#/components/schemas/SchoolClass" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /classes/{id}: get: operationId: getClass tags: [classes] summary: Get class by ID parameters: - in: path name: id required: true schema: type: string responses: "200": description: Class found content: application/json: schema: $ref: "#/components/schemas/SchoolClass" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" put: operationId: updateClass tags: [classes] summary: Update a class parameters: - in: path name: id required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateClassInput" responses: "200": description: Updated class content: application/json: schema: $ref: "#/components/schemas/SchoolClass" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" delete: operationId: deleteClass tags: [classes] summary: Delete a class parameters: - in: path name: id required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" components: schemas: HealthStatus: type: object properties: status: type: string required: - status ErrorResponse: type: object properties: error: type: string required: - error SuccessResponse: type: object properties: success: type: boolean message: type: string required: - success - message Student: type: object properties: id: type: string fullName: type: string rollNo: type: integer className: type: string section: type: string stream: type: string nullable: true additionalSubject: type: string nullable: true gender: type: string nullable: true dateOfBirth: type: string nullable: true parentName: type: string nullable: true parentMobile: type: string nullable: true address: type: string nullable: true email: type: string nullable: true phone: type: string nullable: true createdAt: type: string required: - id - fullName - rollNo - className - section - createdAt CreateStudentInput: type: object properties: fullName: type: string rollNo: type: integer className: type: string section: type: string stream: type: string additionalSubject: type: string gender: type: string dateOfBirth: type: string parentName: type: string parentMobile: type: string address: type: string email: type: string phone: type: string required: - fullName - rollNo - className - section UpdateStudentInput: type: object properties: fullName: type: string rollNo: type: integer className: type: string section: type: string stream: type: string additionalSubject: type: string gender: type: string dateOfBirth: type: string parentName: type: string parentMobile: type: string address: type: string email: type: string phone: type: string Teacher: type: object properties: id: type: string fullName: type: string subject: type: string email: type: string nullable: true phone: type: string nullable: true assignedClasses: type: array items: type: string nullable: true createdAt: type: string required: - id - fullName - subject - createdAt CreateTeacherInput: type: object properties: fullName: type: string subject: type: string email: type: string phone: type: string assignedClasses: type: array items: type: string required: - fullName - subject UpdateTeacherInput: type: object properties: fullName: type: string subject: type: string email: type: string phone: type: string assignedClasses: type: array items: type: string SchoolClass: type: object properties: id: type: string name: type: string section: type: string teacherId: type: string nullable: true studentCount: type: integer nullable: true createdAt: type: string required: - id - name - section - createdAt CreateClassInput: type: object properties: name: type: string section: type: string teacherId: type: string studentCount: type: integer required: - name - section UpdateClassInput: type: object properties: name: type: string section: type: string teacherId: type: string studentCount: type: integer