Document required special flags per field type

オープン
#850 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

  • #28380 @harshillvashisht による — マージされずにクローズ

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
58/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
documentation

調査の方向性

The issue describes a Directus API behavior and points to api/src/services/fields.ts, api/src/constants.ts, and app/src/stores/fields.ts; first read those references and the docs contribution guidance to identify the relevant documentation page. Document the required special flags for each field type and explain the group alias behavior described here. Done when the docs make the required flags clear to API users.

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

説明

Describe the Bug

GET /fields and GET /fields/{collection} omit alias fields whose meta.special is ['group']. The single-field endpoint returns the same field correctly. Directus Studio hydrates its fields store from bulk GET /fields, so group-accordion fields are missing from the form field definitions and fields nested under them are not rendered in item forms.

This was reproduced on Directus 12.3.1. The same ALIAS_TYPES filter was present in the source tags v12.4.0, v12.4.1, and v12.5.0.

To Reproduce
  1. Create a collection with an item form.
  2. Add a group field using the native group-accordion interface (type: "alias", meta.special: ["group"]).
  3. Assign at least one ordinary field or alias field to that group using meta.group: "group_opmaak".
  4. Request GET /fields/{collection}/group_opmaak and GET /fields/{collection}?limit=-1.
  5. Open an item in Studio.
Expected Behavior

The group alias is included in bulk field metadata, and the item form renders the group and its child fields.

Actual Behavior

The single-field endpoint returns the group, but both bulk field endpoints omit it. The Studio item form does not render the group or its children.

For example, with a block_image collection:

  • GET /fields/block_image/group_opmaak returns type: "alias", meta.special: ["group"], meta.interface: "group-accordion", meta.hidden: false.
  • GET /fields/block_image/usages returns a visible list-o2m alias with meta.group: "group_opmaak".
  • GET /fields/block_image?limit=-1 includes usages but omits group_opmaak.
  • In a fresh Studio session, neither group_opmaak nor usages appears in the item form. Moving usages temporarily to the collection root makes it render, confirming the relation itself is functional.
Additional Context

In api/src/services/fields.ts, FieldsService.readAll() filters alias fields by whether their special values match ALIAS_TYPES. In api/src/constants.ts, ALIAS_TYPES includes alias, o2m, m2m, m2a, o2a, files, and translations, but not group. The Studio field store hydrates from GET /fields (app/src/stores/fields.ts) and resolves group children from that store.

Source references:

Attempting to persist meta.special: ["alias", "group"] through the field API was normalized back to ["group"], so this is not currently configurable through the public field API.

主要言語
TypeScript
スター
24
フォーク
90
平均マージ
3日 22時間
マージ済み PR(30日)
19

環境構築

はじめの一歩

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

directus/docs のほかの issue

directus/docs の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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