Anujcodecraft / Anujcodecraft/notes-online
### ✅ Uploading PYQ Fails – Missing `uploader` & `branch` not ObjectId**
- Ngôn ngữ chính
- JavaScript
- Star
- 7
- Fork
- 7
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
## 🛠️ Uploading PYQ Fails – Missing `uploader` & `branch` not ObjectId
### 🐛 Description:
Uploading a PYQ fails due to two schema validation issues:
1. `branch` expects an `ObjectId`, but receives a string.
2. `uploader` field is missing in the payload.
---
### 💥 Error Response:
```json
{
"error": "Validation failed",
"details": {
"branch": {
"stringValue": "\"CSE\"",
"valueType": "string",
"kind": "ObjectId",
"value": "CSE",
"path": "branch",
"name": "CastError",
"message": "Cast to ObjectId failed for value \"CSE\" at path \"branch\""
},
"uploader": {
"name": "ValidatorError",
"message": "Path `uploader` is required.",
"properties": {
"message": "Path `uploader` is required.",
"type": "required",
"path": "uploader"
},
"kind": "required",
"path": "uploader"
}
}
}
✅ Expected Behavior:
PYQ should be uploaded successfully when valid data is provided.
❌ Actual Behavior:
Validation fails and returns 400 status.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.