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

API Platform ignores array shapes in the JSON Schema

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

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

@afraca がすでに取り組んでいます。

2026年10月26日 から。

  • #8767 @afraca による — オープン

評価

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

調査の方向性

まず getJsonSchemaFromType() を見つけ、CollectionType の処理を追ってください。issue では、配列の形状を調べる箇所としてこのメソッドが有力だと示されています。PHPDoc の array{total: int, processed: int, failed: int} が現在どのように表現されているかを確認し、生成されたスキーマを例の名前付きフィールドと比較してください。スキーマに各形状フィールドとその型が保持されれば完了です。

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

説明

Description
A property documented with a PHPDoc array shape generates a schema without its field names. The shape becomes a generic map whose value type is the union of all field types. Here you see it going different from what we expect and hope for:

/** @var array{total: int, processed: int, failed: int} */
public array $totals = [];

Example

Before:

totals: { [key: string]: number }

After:

totals: {
  total: number
  processed: number
  failed: number
}

I could drop the whole cause and suggested AI fix here, but don't think anyone wants that...
The gist is, possibly add it in getJsonSchemaFromType(), before the CollectionType branch with if ($type instanceof ArrayShapeType) .

主要言語
PHP
スター
2.6k
フォーク
987
平均マージ
1日 22時間
マージ済み PR(30日)
87

環境構築

はじめの一歩

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

api-platform/core のほかの issue

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

似ている issue

PHP の issue をもっと見る

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

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