Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

REST schema advertises unsupported media types for upload and script-files

Đang mở Phù hợp với người mới
#76 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api

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ả

app: scripts severity: low status: backlog type: bug
Plugin Version

v0.0.1

NetBox Version

v4.7.3

Python Version

3.12

Steps to Reproduce
  1. As a superuser, use Scripts > Projects > Upload Script to create an upload-based Project containing a valid deploy.py. Note the Project ID.
  2. 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/
  3. Send an authenticated JSON POST to the upload endpoint, with the contents of deploy.py as a string in file.
  4. Send an authenticated multipart PUT to the script-files endpoint, with a text part named paths containing deploy.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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của netbox-community/netbox-scripts

Tất cả issue của netbox-community/netbox-scripts

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.