Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#76 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api

調査の方向性

まず、プロジェクトのアップロードとスクリプトファイルの各エンドポイントに関する API スキーマ宣言を見つけ、そこで示されているメディアタイプと各アクションが受け付けるリクエスト形式を比較してください。POST /projects/{id}/upload/ のスキーマには multipart/form-data のみが、PUT /projects/{id}/script-files/ のスキーマには application/json のみが記載されていることを確認し、生成された Swagger UI で両方の形式を確認してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
8
フォーク
0
平均マージ
11時間 23分
マージ済み PR(30日)
24

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

netbox-community/netbox-scripts のほかの issue

netbox-community/netbox-scripts の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。