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

OpenAPI schema for POST /api/v3/packages does not reflect paginated and polymorphic response

オープン
#2,331 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
openapi, python

調査の方向性

POST /api/v3/packages/ の OpenAPI 定義から始め、レスポンススキーマがどのように生成されるかを調査します。ドキュメント化されたレスポンスが、パラメーターに依存する PURL-string または PackageV3 の結果を含む、実際の 200 ページネーション構造と一致することを確認し、生成されたドキュメントまたはクライアントのパース処理が修正後のレスポンスを反映していることを確認します。

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

説明

The current OpenAPI schema incorrectly documents the response structure of the POST /api/v3/packages/ endpoint.

The schema currently lists a 201 response as a direct mapping to #/components/schemas/PackageV3:

        "/api/v3/packages/": {
            "post": {
                "operationId": "v3_packages_create",
                "tags": [
                    "v3"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PackageQuery"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/PackageQuery"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/PackageQuery"
                            }
                        }
                    }
                },
                "security": [
                    {
                        "cookieAuth": []
                    },
                    {
                        "tokenAuth": []
                    },
                    {}
                ],
                "responses": {
                    "201": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PackageV3"
                                }
                            }
                        },
                        "description": ""
                    }
                }
            }
        },

However, the actual API response is paginated, and the contents of the results array vary depending on request parameters (such as the details boolean option), so the response can also contain a list of PURL strings, instead of PackageV3 objects.

The response also has an incorrect status code in the schema (actual status code is 200).

This causes automated client generators to fail to parse the actual API responses because they expect a 201 flat object instead of the 200 paginated response structure.

主要言語
Python
スター
716
フォーク
347
平均マージ
13時間 47分
マージ済み PR(30日)
8

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

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

aboutcode-org/vulnerablecode のほかの issue

aboutcode-org/vulnerablecode の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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