fix: Fix OpenAPI schema generation
Fix OpenAPI schema generation for GET /api/instructor/v2/courses/{course_id} to properly show documentation.
This commit is contained in:
@@ -46,71 +46,6 @@ class CourseMetadataView(DeveloperErrorViewMixin, APIView):
|
||||
|
||||
Retrieve comprehensive course metadata including enrollment counts, dashboard configuration,
|
||||
permissions, and navigation sections.
|
||||
|
||||
**Example Requests**
|
||||
|
||||
GET /api/instructor/v2/courses/{course_id}
|
||||
|
||||
**Response Values**
|
||||
|
||||
{
|
||||
"course_id": "course-v1:edX+DemoX+Demo_Course",
|
||||
"display_name": "Demonstration Course",
|
||||
"org": "edX",
|
||||
"course_number": "DemoX",
|
||||
"enrollment_start": "2013-02-05T00:00:00Z",
|
||||
"enrollment_end": null,
|
||||
"start": "2013-02-05T05:00:00Z",
|
||||
"end": "2024-12-31T23:59:59Z",
|
||||
"pacing": "instructor",
|
||||
"has_started": true,
|
||||
"has_ended": false,
|
||||
"total_enrollment": 150,
|
||||
"enrollment_counts": {
|
||||
"total": 150,
|
||||
"audit": 100,
|
||||
"verified": 40,
|
||||
"honor": 10
|
||||
},
|
||||
"num_sections": 12,
|
||||
"grade_cutoffs": "A is 0.9, B is 0.8, C is 0.7, D is 0.6",
|
||||
"course_errors": [],
|
||||
"studio_url": "https://studio.example.com/course/course-v1:edX+DemoX+2024",
|
||||
"permissions": {
|
||||
"admin": false,
|
||||
"instructor": true,
|
||||
"finance_admin": false,
|
||||
"sales_admin": false,
|
||||
"staff": true,
|
||||
"forum_admin": true,
|
||||
"data_researcher": false
|
||||
},
|
||||
"tabs": [
|
||||
{
|
||||
"tab_id": "courseware",
|
||||
"title": "Course",
|
||||
"url": "INSTRUCTOR_MICROFRONTEND_URL/courses/course-v1:edX+DemoX+2024/courseware"
|
||||
},
|
||||
{
|
||||
"tab_id": "progress",
|
||||
"title": "Progress",
|
||||
"url": "INSTRUCTOR_MICROFRONTEND_URL/courses/course-v1:edX+DemoX+2024/progress"
|
||||
},
|
||||
],
|
||||
"disable_buttons": false,
|
||||
"analytics_dashboard_message": "To gain insights into student enrollment and participation..."
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
course_key: Course key for the course.
|
||||
|
||||
**Returns**
|
||||
|
||||
* 200: OK - Returns course metadata
|
||||
* 401: Unauthorized - User is not authenticated
|
||||
* 403: Forbidden - User lacks instructor permissions
|
||||
* 404: Not Found - Course does not exist
|
||||
"""
|
||||
|
||||
permission_classes = (IsAuthenticated, permissions.InstructorPermission)
|
||||
|
||||
@@ -357,7 +357,6 @@ class CourseInformationSerializerV2(serializers.Serializer):
|
||||
return get_analytics_dashboard_message(data['course'].id)
|
||||
|
||||
|
||||
|
||||
class InstructorTaskSerializer(serializers.Serializer):
|
||||
"""Serializer for instructor task details."""
|
||||
task_id = serializers.UUIDField()
|
||||
|
||||
Reference in New Issue
Block a user