a2ui-project / a2ui-project/a2ui

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

Ouverte
#1,552 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
a: api-simplicity component: specification component: standard catalog specification P2 sprint ready type: feature/enhancement
Langage dominant
TypeScript
Étoiles
16.4k
Forks
1.3k
Merge moyen
3 j 15 h
PR mergées (30 j)
134

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Le travail se trouve dans le répertoire `specification/v0_10/`. Commence par examiner `catalogs/basic/catalog.json` et `catalogs/minimal/catalog.json` pour comprendre la structure actuelle de `$defs`. Ensuite, aplatis les schemas comme décrit, en mettant à jour les références. Mets aussi à jour `json/common_types.json` et `json/server_to_client.json`. Enfin, modifie `json/client_capabilities.json` pour imposer les propriétés requises. Exécute les tests dans `specification/v0_10/test/` pour vérifier les changements.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
json, typescript
Domaine
backend-api-design
Type d'issue
Refactorisation
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Clairement spécifiée
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.