diff --git a/api/fhda_api_1.1.yaml b/api/fhda_api_1.1.yaml new file mode 100644 index 0000000..72f5551 --- /dev/null +++ b/api/fhda_api_1.1.yaml @@ -0,0 +1,562 @@ +swagger: '2.0' +info: + description: Initial API for FHDA + version: "1.1.4" + title: FHDA API + + license: + name: License Not determined + url: http://www.blank.org + +paths: +#################COURSE OPERATIONS########################### + /courses: + get: + summary: get courses of a given quarter (possibly specify the department) + operationId: getCourses + description: | + Search for all courses of a quarter (possibly specify the department) + produces: + - application/json + parameters: + - in: query + name: quarter + description: the quarter for displaying + type: string + required: true + - in: query + name: department + description: the department for displaying + type: string + required: false + responses: + 200: + description: search results matching criteria + 400: + description: bad input parameter + 404: + description: cannot find the course with given parameter + + /course: + get: + summary: get course info by passing parameters + operationId: getCourse + description: | + Search for course by quarter + produces: + - application/json + parameters: + - in: query + name: quarter + description: the quarter for searching + type: string + required: true + - in: query + name: crn + description: the crn for searching + type: string + required: false + responses: + 200: + description: search results matching criteria + schema: + type: array + items: + $ref: '#/definitions/CourseAcctD001A' + 400: + description: bad input parameter + 404: + description: cannot find the course with given parameter + + put: + summary: adds a new course + operationId: addCourse + description: Adds a course to the system + parameters: + - in: body + name: course + description: course object to add + schema: + $ref: '#/definitions/CourseAcctD001A' + responses: + 201: + description: course created + 400: + description: invalid input, object invalid + 409: + description: an existing course already exists + + post: + summary: edit a course + operationId: editCourse + description: Edits a course in the system + parameters: + - in: query + name: crn + description: using crn for searching + type: string + required: true + responses: + 201: + description: course editted + 400: + description: invalid input, object invalid + + delete: + summary: deletes a course + operationId: deleteCourse + description: Deletes a course from the system + parameters: + - in: query + name: crn + description: using crn for searching + type: string + required: true + responses: + 200: + description: course deleted + 400: + description: invalid input, object invalid + 404: + description: requested course not found + + + +#################DEPTARTMENT OPERATIONS########################### + /department: + get: + summary: get deptartment info + operationId: getDept + description: | + Search for department given input department name + produces: + - application/json + parameters: + - in: query + name: deptName + description: the department name for searching + type: string + required: true + responses: + 200: + description: search results matching criteria + schema: + type: array + items: + $ref: '#/definitions/DepartmentAcct' + 400: + description: bad input parameter + 404: + description: cannot find the department with given parameter + + put: + summary: adds a department + operationId: addDept + description: Adds a department to the system + parameters: + - in: body + name: department + description: departmentr object to add + schema: + $ref: '#/definitions/DepartmentAcct' + responses: + 201: + description: department created + 400: + description: invalid input, object invalid + 409: + description: an existing department already exists + + post: + summary: edit a department + operationId: editDepartment + description: Edits a department in the system + parameters: + - in: query + name: departmentName + description: using department name for searching + type: string + required: true + responses: + 201: + description: department editted + 400: + description: invalid input, object invalid + + delete: + summary: deletes a department + operationId: deleteDepartment + description: Deletes a department from the system + parameters: + - in: query + name: departmentName + description: using department name for searching + type: string + required: true + responses: + 200: + description: department deleted + 400: + description: invalid input, object invalid + 404: + description: requested department not found + + +#################Instructor OPERATIONS########################### + /instructor: + get: + summary: get instructor info + operationId: getInstructor + description: | + Search for an instructor using either instructor name or course crn + produces: + - application/json + parameters: + - in: query + name: instructorName + description: using instructor name for searching + type: string + required: false + - in: query + name: crn + description: search for the instructor of a specific course + type: string + required: false + responses: + 200: + description: search results matching criteria + schema: + type: array + items: + $ref: '#/definitions/InstructorFarshod' + 400: + description: bad input parameter + 404: + description: cannot find the instructor with given parameter + + put: + summary: adds an instructor + operationId: addInstructor + description: Adds an instructor to the system + parameters: + - in: body + name: instructor + description: instructor object to add + schema: + $ref: '#/definitions/InstructorFarshod' + responses: + 201: + description: instructor added + 400: + description: invalid input, object invalid + 409: + description: an existing instructor already exists + + post: + summary: edit an instructor + operationId: editInstructor + description: Edits an instructor in the system + parameters: + - in: query + name: instructorName + description: using instructor name for searching + type: string + required: true + responses: + 201: + description: instructor editted + 400: + description: invalid input, object invalid + + delete: + summary: deletes an instructor + operationId: deleteInstructor + description: Deletes an instructor from the system + parameters: + - in: query + name: instructorName + description: using instructor name for searching + type: string + required: true + responses: + 200: + description: instructor deleted + 400: + description: invalid input, object invalid + 404: + description: requested instructor not found + + + +###############################DEFINITIONS############################### +definitions: + CourseAcctD001A: + type: object + required: + - crn + - courseName + - instructorName + - Dates + - Time + properties: + crn: + type: string + format: uuid + example: 00002 + courseName: + type: string + example: FINAN ACCOUNTNG I + courseNum: + type: string + example: D001A + days: + type: string + example: TR + startDate: + type: string + format: date + example: 09/02 + endDate: + type: string + format: date + example: 12/12 + startTime: + type: string + example: 8:00 am + endTime: + type: string + example: 10:00 am + capacity: + type: integer + example: 40 + wl_capacity: + type: integer + example: 10 + active: + type: array + items: + type: integer + format: int32 + example: 0, 0, 1, 13 + + wl_active: + type: array + items: + type: integer + format: int32 + example: 0, 0, 0, 0 + fetchTime: + type: array + items: + type: string + format: date-time + example: 2018-07-02T15:00:00Z, 2018-07-02T18:00:00Z, + 2018-07-03T15:00:00Z, 2018-07-03T18:00:00Z + instructor: + $ref: '#/definitions/InstructorFarshod' + department: + $ref: '#/definitions/DepartmentAcct/properties/dept_name' + + CourseCSD022A: + type: object + required: + - crn + - courseName + - instructorName + - Dates + - Time + properties: + crn: + type: string + format: uuid + example: 44663 + courseName: + type: string + example: Beginning Programming Methodologies in C++ + courseNum: + type: string + example: D022A + days: + type: string + example: MW + startDate: + type: string + format: date + example: 04/09 + endDate: + type: string + format: date + example: 06/29 + startTime: + type: string + example: 08:00 pm + endTime: + type: string + example: 09:50 pm + capacity: + type: integer + example: 40 + wl_capacity: + type: integer + example: 10 + active: + type: array + items: + type: integer + format: int32 + example: 0, 20, 27, 40 + wl_active: + type: array + items: + type: integer + format: int32 + example: 0, 0, 0, 10 + fetchTime: + type: array + items: + type: string + format: date-time + example: 2018-03-02T15:00:00Z, 2018-03-02T18:00:00Z, + 2018-04-03T15:00:00Z, 2018-05-03T18:00:00Z + + CoursePhysicsD004A: + type: object + required: + - crn + - courseName + - instructorName + - Dates + - Time + properties: + crn: + type: string + format: uuid + example: 02076 + courseName: + type: string + example: PHYS SCIENT/ENG:MECHANCS + courseNum: + type: string + example: D004A + days: + type: string + example: MTWRF + startDate: + type: string + format: date + example: 09/20 + endDate: + type: string + format: date + example: 12/10 + startTime: + type: string + example: 09:30 am + endTime: + type: string + example: 12:15 pm + lab: + $ref: '#/definitions/LabPhysicsD004A' + capacity: + type: integer + example: 40 + wl_capacity: + type: integer + example: 10 + active: + type: array + items: + type: integer + format: int32 + example: 0, 20, 27, 40 + wl_active: + type: array + items: + type: integer + format: int32 + example: 0, 0, 0, 10 + fetchTime: + type: array + items: + type: string + format: date-time + example: 2018-03-02T15:00:00Z, 2018-03-02T18:00:00Z, + 2018-04-03T15:00:00Z, 2018-05-03T18:00:00Z + + InstructorFarshod: + required: + - name + properties: + name: + type: string + example: Mosh,Farshod + email: + type: string + example: moshfarshod@fhda.edu + phone: + type: string + example: 1234567890 + + InstructorLuna: + required: + - name + properties: + name: + type: string + example: Eduardo,F,Luna + email: + type: string + example: eduardoluna@fhda.edu + phone: + type: string + example: 3213123133 + + DepartmentAcct: + required: + - dept_name + properties: + dept_name: + type: string + example: ACCT + courses: + type: array + example: 00002, 00004 + instructors: + type: array + example: Accounting Instructor, Accounting Professor + + LabPhysicsD004A: + required: + - uid + properties: + uid: + type: string + example: 02076L + days: + type: string + example: W + startDate: + type: string + format: date + example: 09/20 + endDate: + type: string + format: date + example: 12/10 + startTime: + type: string + example: 09:30 am + endTime: + type: string + example: 12:15 pm + instructor: + $ref: '#/definitions/InstructorLuna' + location: + type: string + example: DA S11 + +# Added by API Auto Mocking Plugin +host: virtserver.swaggerhub.com +basePath: /yifeili98/FHDA_Incubator/1.1.4 +schemes: + - https \ No newline at end of file