Document required special flags per field type
维护者通常 2 天内回复
还没有人认领这个 Issue。
- #28380 来自 @harshillvashisht —— 已关闭,未合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 58/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
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
- Create a collection with an item form.
- Add a group field using the native
group-accordioninterface (type: "alias",meta.special: ["group"]). - Assign at least one ordinary field or alias field to that group using
meta.group: "group_opmaak". - Request
GET /fields/{collection}/group_opmaakandGET /fields/{collection}?limit=-1. - 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_opmaakreturnstype: "alias",meta.special: ["group"],meta.interface: "group-accordion",meta.hidden: false.GET /fields/block_image/usagesreturns a visiblelist-o2malias withmeta.group: "group_opmaak".GET /fields/block_image?limit=-1includesusagesbut omitsgroup_opmaak.- In a fresh Studio session, neither
group_opmaaknorusagesappears in the item form. Movingusagestemporarily 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:
- https://github.com/directus/directus/blob/v12.3.1/api/src/services/fields.ts
- https://github.com/directus/directus/blob/v12.3.1/api/src/constants.ts
- https://github.com/directus/directus/blob/v12.3.1/app/src/stores/fields.ts
- https://github.com/directus/directus/blob/v12.3.1/app/src/components/v-form/v-form.vue
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 小时
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
directus/docs 的其他 Issue
-
Docs Platform
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
-
llms.txt links agents to /raw/ copies where partials are empty; the inlined .md copies aren't linked未关闭
难度 3/5 1-2 天 新手友好度 67/100
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 2 天内回复
-
content-improvement
难度 5/5 一周以上 新手友好度 35/100
维护者通常 2 天内回复
-
Document `Directus-File-Id header` for TUS needs `CORS_EXPOSED_HEADERS` set for external domains可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
ranxianglei/billion-context#7597 ·
维护者通常 1 天内回复
-
kubernetes-ingestor: fetchCRDMapping() runs even when crossplane.enabled is false, logging a 403 ERROR every run可能已有人在做 @kc9ddi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
TeraSky-OSS/backstage-plugins#228 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
zmkfirmware/zmk#3571 ·
维护者通常 10 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client area可能已有人在做 @lijy91 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
libnativeapi/nativeapi#53 · 1 个 reaction ·
维护者通常 1 天内回复