Skip to content

Commit

Permalink
feat: migrate API documentation from README.md to API-docs.md for bet…
Browse files Browse the repository at this point in the history
…ter organization
  • Loading branch information
lakminagamage committed Dec 14, 2024
1 parent 5f05333 commit 0f3bc5d
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 183 deletions.
186 changes: 186 additions & 0 deletions API-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# Student Service API

This API provides CRUD operations for managing students, academic histories, and courses.

## Endpoints

### Students

- **Create Student**
- **URL:** `/students/`
- **Method:** `POST`
- **Request Body:**
```json
{
"name": "string",
"age": "integer",
"email": "string"
}
```
- **Response:**
```json
{
"id": "integer",
"name": "string",
"age": "integer",
"email": "string"
}
```

- **Get Student**
- **URL:** `/students/{student_id}`
- **Method:** `GET`
- **Response:**
```json
{
"id": "integer",
"name": "string",
"age": "integer",
"email": "string"
}
```

- **Get Students**
- **URL:** `/students/`
- **Method:** `GET`
- **Query Parameters:**
- `skip`: integer (default: 0)
- `limit`: integer (default: 10)
- **Response:**
```json
[
{
"id": "integer",
"name": "string",
"age": "integer",
"email": "string"
}
]
```

- **Delete Student**
- **URL:** `/students/{student_id}`
- **Method:** `DELETE`
- **Response:**
```json
{
"id": "integer",
"name": "string",
"age": "integer",
"email": "string"
}
```

### Academic History

- **Create Academic History**
- **URL:** `/students/{student_id}/academic-history/`
- **Method:** `POST`
- **Request Body:**
```json
{
"course_name": "string",
"grade": "string"
}
```
- **Response:**
```json
{
"id": "integer",
"course_name": "string",
"grade": "string",
"student_id": "integer"
}
```

- **Get Academic History**
- **URL:** `/students/{student_id}/academic-history/`
- **Method:** `GET`
- **Response:**
```json
[
{
"id": "integer",
"course_name": "string",
"grade": "string",
"student_id": "integer"
}
]
```

### Courses

- **Create Course**
- **URL:** `/courses/`
- **Method:** `POST`
- **Request Body:**
```json
{
"name": "string",
"description": "string"
}
```
- **Response:**
```json
{
"id": "integer",
"name": "string",
"description": "string"
}
```

- **Get Course**
- **URL:** `/courses/{course_id}`
- **Method:** `GET`
- **Response:**
```json
{
"id": "integer",
"name": "string",
"description": "string"
}
```

- **Get Courses**
- **URL:** `/courses/`
- **Method:** `GET`
- **Query Parameters:**
- `skip`: integer (default: 0)
- `limit`: integer (default: 10)
- **Response:**
```json
[
{
"id": "integer",
"name": "string",
"description": "string"
}
]
```

### Enrollments

- **Enroll Student in Course**
- **URL:** `/students/{student_id}/courses/{course_id}`
- **Method:** `POST`
- **Response:**
```json
{
"student_id": "integer",
"course_id": "integer"
}
```

- **Get Student Courses**
- **URL:** `/students/{student_id}/courses/`
- **Method:** `GET`
- **Response:**
```json
[
{
"id": "integer",
"name": "string",
"description": "string"
}
]
```
183 changes: 0 additions & 183 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,186 +1,3 @@
# Student Service API

This API provides CRUD operations for managing students, academic histories, and courses.

## Endpoints

### Students

- **Create Student**
- **URL:** `/students/`
- **Method:** `POST`
- **Request Body:**
```json
{
"name": "string",
"age": "integer",
"email": "string"
}
```
- **Response:**
```json
{
"id": "integer",
"name": "string",
"age": "integer",
"email": "string"
}
```

- **Get Student**
- **URL:** `/students/{student_id}`
- **Method:** `GET`
- **Response:**
```json
{
"id": "integer",
"name": "string",
"age": "integer",
"email": "string"
}
```

- **Get Students**
- **URL:** `/students/`
- **Method:** `GET`
- **Query Parameters:**
- `skip`: integer (default: 0)
- `limit`: integer (default: 10)
- **Response:**
```json
[
{
"id": "integer",
"name": "string",
"age": "integer",
"email": "string"
}
]
```

- **Delete Student**
- **URL:** `/students/{student_id}`
- **Method:** `DELETE`
- **Response:**
```json
{
"id": "integer",
"name": "string",
"age": "integer",
"email": "string"
}
```

### Academic History

- **Create Academic History**
- **URL:** `/students/{student_id}/academic-history/`
- **Method:** `POST`
- **Request Body:**
```json
{
"course_name": "string",
"grade": "string"
}
```
- **Response:**
```json
{
"id": "integer",
"course_name": "string",
"grade": "string",
"student_id": "integer"
}
```

- **Get Academic History**
- **URL:** `/students/{student_id}/academic-history/`
- **Method:** `GET`
- **Response:**
```json
[
{
"id": "integer",
"course_name": "string",
"grade": "string",
"student_id": "integer"
}
]
```

### Courses

- **Create Course**
- **URL:** `/courses/`
- **Method:** `POST`
- **Request Body:**
```json
{
"name": "string",
"description": "string"
}
```
- **Response:**
```json
{
"id": "integer",
"name": "string",
"description": "string"
}
```

- **Get Course**
- **URL:** `/courses/{course_id}`
- **Method:** `GET`
- **Response:**
```json
{
"id": "integer",
"name": "string",
"description": "string"
}
```

- **Get Courses**
- **URL:** `/courses/`
- **Method:** `GET`
- **Query Parameters:**
- `skip`: integer (default: 0)
- `limit`: integer (default: 10)
- **Response:**
```json
[
{
"id": "integer",
"name": "string",
"description": "string"
}
]
```

### Enrollments

- **Enroll Student in Course**
- **URL:** `/students/{student_id}/courses/{course_id}`
- **Method:** `POST`
- **Response:**
```json
{
"student_id": "integer",
"course_id": "integer"
}
```

- **Get Student Courses**
- **URL:** `/students/{student_id}/courses/`
- **Method:** `GET`
- **Response:**
```json
[
{
"id": "integer",
"name": "string",
"description": "string"
}
]
```

0 comments on commit 0f3bc5d

Please sign in to comment.