a2ui-project / a2ui-project/a2ui
Simplify and Flatten Catalog Schemas & Tighten client_capabilities Catalog Schema in v0.10
- 主要言語
- TypeScript
- スター
- 16.4k
- フォーク
- 1.3k
- 平均マージ
- 3日 15時間
- マージ済み PR(30日)
- 134
説明
### Description
In A2UI v0.10, the catalog schemas (`catalogs/basic/catalog.json` and `catalogs/minimal/catalog.json`) have a structural inconsistency: some schemas are declared under root properties (such as `components` and `functions`), while standard schema helpers (`CatalogComponentCommon`, `theme`, `anyComponent`, `anyFunction`) are nested under `$defs`. This nesting adds unnecessary complexity and results in asymmetric, deep pointers.
This issue will simplify all catalog schemas in `v0.10` by standardizing on direct top-level declarations (removing `$defs` entirely). It will also update any reference files in `v0.10` pointing to these elements.
Furthermore, we will tighten the `Catalog` schema inside `specification/v0_10/json/client_capabilities.json` so that it accurately describes a compliant catalog structure (requiring `anyComponent`, `anyFunction`, and `theme` schemas at the root level, but leaving `catalogComponentCommon` optional).
### Scope of Work
1. **Flatten Basic and Minimal Catalogs:**
- In `specification/v0_10/catalogs/basic/catalog.json` and `specification/v0_10/catalogs/minimal/catalog.json`, remove `$defs` completely.
- Move `theme`, `anyComponent`, `anyFunction` directly into the catalog's root.
- Rename `CatalogComponentCommon` to `catalogComponentCommon` (camelCase) and move it directly to the root as an optional helper.
- Update all local references within these catalogs (e.g., pointing `{"$ref": "#/$defs/CatalogComponentCommon"}` to `{"$ref": "#/catalogComponentCommon"}`).
2. **Update Protocol Schemas for New Pointers:**
- In `specification/v0_10/json/common_types.json`, change function call union pointer from `catalog.json#/$defs/anyFunction` to `catalog.json#/anyFunction`.
- In `specification/v0_10/json/server_to_client.json`, update `theme` to `catalog.json#/theme` and `anyComponent` to `catalog.json#/anyComponent`.
3. **Tighten client_capabilities.json:**
- Standardize `Catalog` properties to be direct properties.
- Ensure `functions` is typed as an object of standard JSON Schemas rather than an array of descriptions.
- Enforce required root properties: `catalogId`, `components`, `functions`, `theme`, `anyComponent`, and `anyFunction`.
- Keep `catalogComponentCommon` as an optional property schema at the root.
4. **Verify the change:**
- Ensure the repository schemas remain valid and pass any local testing suites (e.g., `specification/v0_10/test`).
コントリビューションガイド
調査の方向性
作業対象は `specification/v0_10/` ディレクトリです。まず `catalogs/basic/catalog.json` と `catalogs/minimal/catalog.json` を確認して、現在の `$defs` 構造を理解してください。次に、説明されているとおりに schemas をフラット化し、参照を更新します。`json/common_types.json` と `json/server_to_client.json` も更新してください。最後に、必須 properties を強制するように `json/client_capabilities.json` を修正します。変更を検証するために `specification/v0_10/test/` の tests を実行してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- json, typescript
- 領域
- backend-api-design
- issue の種類
- リファクタリング
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100