a2ui-project / a2ui-project/a2ui
Simplify and Flatten Catalog Schemas & Tighten client_capabilities Catalog Schema in v0.10
- Lingua principale
- TypeScript
- Stelle
- 16.4k
- Fork
- 1.3k
- Merge medio
- 3g 15h
- PR unite (30g)
- 134
Descrizione
### 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`).
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Il lavoro si trova nella directory `specification/v0_10/`. Inizia esaminando `catalogs/basic/catalog.json` e `catalogs/minimal/catalog.json` per capire l'attuale struttura di `$defs`. Poi, appiattisci gli schemas come descritto, aggiornando i riferimenti. Aggiorna anche `json/common_types.json` e `json/server_to_client.json`. Infine, modifica `json/client_capabilities.json` per imporre le proprietà richieste. Esegui i test in `specification/v0_10/test/` per verificare le modifiche.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- json, typescript
- Ambito
- backend-api-design
- Tipo di issue
- Refactoring
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 55/100