a2ui-project / a2ui-project/a2ui

Simplify and Flatten Catalog Schemas & Tighten client_capabilities Catalog Schema in v0.10

Offen
#1,552 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
a: api-simplicity component: specification component: standard catalog specification P2 sprint ready type: feature/enhancement
Vorherrschende Sprache
TypeScript
Sterne
16.4k
Forks
1.3k
Ø Merge
3 T. 15 Std.
Gemergte PRs (30 T.)
134

Beschreibung

### 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`).

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Die Arbeit befindet sich im Verzeichnis `specification/v0_10/`. Beginne damit, `catalogs/basic/catalog.json` und `catalogs/minimal/catalog.json` zu untersuchen, um die aktuelle `$defs`-Struktur zu verstehen. Danach die Schemas wie beschrieben flattenen und die References aktualisieren. Aktualisiere außerdem `json/common_types.json` und `json/server_to_client.json`. Ändere schließlich `json/client_capabilities.json`, um die erforderlichen Properties zu erzwingen. Führe die Tests in `specification/v0_10/test/` aus, um die Änderungen zu verifizieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
json, typescript
Bereich
backend-api-design
Issue-Typ
Refactoring
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.