Azure / Azure/data-api-builder
[Enh]: For auto-config entities support `@file()`
- Lenguaje dominante
- C#
- Estrellas
- 1.5k
- Forks
- 370
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 9
Descripción
## 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.
Guía de contribución
Línea de trabajo
Empieza rastreando cómo se expande autoentities.template y cómo se fusionan los metadata-files. Verifica que las macros de plantilla se expandan durante la generación de auto-entities antes de que las claves resultantes se resuelvan mediante @file(); se considera terminado cuando los valores de metadatos a nivel de tabla, parámetro y columna se heredan del diccionario de metadatos fusionado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- api, backend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100