data-api-builder
data-api-builder copied to clipboard
[Enh]: Additional `template` properties to `autoentities`
What
Today, autoentities.template is missing our newest metadata-driven properties, such as description.
This enhancement depends on the following:
- #2794
- #2940
New properties
This uses the new @db() syntax but behaves differently. Because internal macros like {schema}, {object}, and {column} are resolved dynamically within the auto-entity generation loop, these replacements cannot occur at config load time (like normal @db() resolution). Instead, they must be evaluated after the auto-generated entities have been expanded.
{
"template": {
"description": "@db('{schema}.{object}:MS_Description')", // new (table-level)
"source": {
"parameters": {
"description": "@db('{schema}.{object}.@{column}:MS_Description')" // new (parameter-level)
}
},
"fields": {
"description": "@db('{schema}.{object}.{column}:MS_Description')" // new (column-level)
}
}
}