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

Array query parameters not correctly handled by OpenAPI UI

クローズ
#8,421 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

Issue の ApiResource/Get QueryParameter の例で再現し、生成された OpenAPI UI を開く。UI のリクエスト URL 用に array クエリパラメーターがどこでシリアライズされるかを追跡し、複数の値が、array キーを繰り返すのではなく、array[]=2&array[]=1&array[]=4 として送信されることを確認する。UI が生成した curl/リクエストが issue の想定 URL と一致すれば完了。

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

説明

Description

When setting a Query Parameter of array type, the OpenAPI UI allows setting multiple values but makes a wrong setup of the actual query parameters (no [] added).

Alternatively, is there a simple way to configure the parsing from Laravel/Symfony to access all provided values? It seems a lot of this is framework and language specific, as other languages support multiple query param with same name as is implemented here.

How to reproduce

#[ApiResource(
    shortName: 'Test',
    operations: [
        new Get(
            parameters: [
                'array' => new QueryParameter(required: false, castToArray: true, schema: ['type' => 'array']),
            ],
        ),
    ],
)]
class Test2Resource
{
    public int $not_id;
}


Image

Possible Solution


curl -X 'GET' \
  'http://localhost/fork/public/api/tests?array=2&array=1&array=4' \
  -H 'accept: application/ld+json'

should be


curl -X 'GET' \
  'http://localhost/fork/public/api/tests?array[]=2&array[]=1&array[]=4' \
  -H 'accept: application/ld+json')

主要言語
PHP
スター
2.6k
フォーク
989
平均マージ
2日 4時間
マージ済み PR(30日)
90

環境構築

はじめの一歩

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

api-platform/core のほかの issue

api-platform/core の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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