REST schema advertises unsupported media types for upload and script-files
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Bắt đầu bằng cách tìm các khai báo lược đồ API cho endpoint tải dự án lên và endpoint tệp script, sau đó so sánh các loại phương tiện được công bố với định dạng yêu cầu mà mỗi hành động chấp nhận. Xác minh rằng lược đồ của POST /projects/{id}/upload/ chỉ liệt kê multipart/form-data và lược đồ của PUT /projects/{id}/script-files/ chỉ liệt kê application/json; kiểm tra Swagger UI được tạo để xác nhận cả hai định dạng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Plugin Version
v0.0.1
NetBox Version
v4.7.3
Python Version
3.12
Steps to Reproduce
- As a superuser, use Scripts > Projects > Upload Script to create an upload-based Project containing a valid
deploy.py. Note the Project ID. - Open
/api/schema/swagger-ui/and inspect the request body media types for:POST /api/plugins/netbox-scripts/projects/{id}/upload/PUT /api/plugins/netbox-scripts/projects/{id}/script-files/
- Send an authenticated JSON POST to the upload endpoint, with the contents of
deploy.pyas a string infile. - Send an authenticated multipart PUT to the script-files endpoint, with a text part named
pathscontainingdeploy.py.
Expected Behavior
The upload schema advertises only multipart/form-data, and the Script File selection schema advertises only application/json.
Observed Behavior
Both operations advertise application/json and multipart/form-data.
The JSON upload returns HTTP 400:
The submitted data was not a file. Check the encoding type on the form.
The multipart selection returns HTTP 400:
Provide a list of source paths.
Multipart uploads and JSON selections work. Swagger UI and generated clients can therefore offer a request format that the action cannot use.
- Ngôn ngữ chính
- Python
- Star
- 8
- Fork
- 0
- Merge trung bình
- 11 giờ 35 phút
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của netbox-community/netbox-scripts
-
app: scripts severity: medium status: backlog type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
netbox-community/netbox-scripts#83 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app: scripts status: backlog type: documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
netbox-community/netbox-scripts#80 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app: scripts severity: medium status: backlog type: bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
netbox-community/netbox-scripts#79 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app: scripts severity: medium status: backlog type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
netbox-community/netbox-scripts#77 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app: scripts severity: low status: backlog type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
netbox-community/netbox-scripts#74 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của netbox-community/netbox-scripts
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
awslabs/visual-asset-management-system#937 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Admin member of a research group cannot see the HX2 allocation until they've been added to itĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 2 ngày