Azure / Azure/data-api-builder

[Enh]: For auto-config entities support `@file()`

Aperta
#3,277 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
2.x auto-config
Lingua principale
C#
Stelle
1.5k
Fork
370
Merge medio
3g 22h
PR unite (30g)
9

Descrizione

## What

Allow `autoentities.template` to reference external metadata files using the new `@file()` syntax.

This enhancement allows auto-generated entities to inherit descriptions or other metadata from configuration-managed metadata files.

This enhancement depends on the following:

* #2794
* #2863

## New properties

This uses the new `@file()` syntax but behaves differently from normal configuration replacements. Because internal macros such as `{schema}`, `{object}`, `{column}`, and `{parameter}` are resolved dynamically within the auto-entity generation loop, these replacements cannot occur during configuration load. Instead, they must be evaluated **after** auto-generated entities have been expanded.

```json
{
"template": {
"description": "@file('{schema}.{object}.MS_Description')", // table-level
"source": {
"parameters": {
"description": "@file('{schema}.{object}.@{parameter}.MS_Description')" // parameter-level
}
},
"fields": {
"description": "@file('{schema}.{object}.{column}.MS_Description')" // column-level
}
}
}
```

In this case the metadata keys correspond to entries in the metadata files configured through `metadata-files`.

Example metadata file:

```json
{
"dbo.Author.MS_Description": "Author records in the system",
"dbo.Author.Id.MS_Description": "Primary key of the author",
"dbo.GetCustomer.@CustomerId.MS_Description": "Identifier of the requested customer"
}
```

During auto-entity generation, the template macros are expanded first and the resulting keys are resolved using `@file()` against the merged metadata dictionary.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando come viene espanso autoentities.template e come vengono uniti i metadata-files. Verifica che le macro del template vengano espanse durante la generazione degli auto-entity prima che le chiavi risultanti vengano risolte tramite @file(); è completato quando i valori dei metadati a livello di tabella, parametro e colonna vengono ereditati dal dizionario dei metadati unito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
api, backend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.