[Bug]: `autoentities` in a child configuration file (referenced via `data-source-files`) is not recognized — validation fails with "No entities found"
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Description
When using multiple configuration files (one top-level file referencing others via data-source-files), autoentities defined in a child configuration file is not expanded during configuration validation. Validation fails with:
Config '<child-config>.json': No entities found. At least one entity must be defined or discovered from autoentities when a data source is configured.
fail: Config is invalid.
The same autoentities block works correctly when placed in the top-level configuration file. Only child files (referenced through data-source-files) are affected.
This appears to contradict the documented multi-file rules, which state that every configuration file may satisfy the entities requirement with either entities or autoentities:
Multiple configuration rules
- Every configuration file must include the
data-sourceproperty.- Every configuration file must include the
entitiesproperty (or autoentities).
(See: Configuration schema reference — "Data source files" / "Multiple configuration rules".)
Version
Data API builder 2.0.8
Steps to reproduce
- Create a top-level config that references a child config and uses
autoentitiesitself:
// dab-config.json (top-level)
{
"$schema": "https://github.com/Azure/data-api-builder/releases/download/v2.0.8/dab.draft.schema.json",
"data-source": { "database-type": "mssql", "connection-string": "@env('CONN_A')" },
"data-source-files": [ "dab-config.child.json" ],
"runtime": {
"mcp": { "enabled": true },
"host": { "mode": "production", "authentication": { "provider": "Unauthenticated" } }
},
"autoentities": {
"def-a": {
"patterns": { "name": "a_{object}", "include": [ "dbo.TableOne" ] },
"permissions": [ { "role": "anonymous", "actions": [ { "action": "read" } ] } ]
}
}
}
- Create a child config that uses
autoentities(no explicitentities):
// dab-config.child.json
{
"$schema": "https://github.com/Azure/data-api-builder/releases/download/v2.0.8/dab.draft.schema.json",
"data-source": { "database-type": "mssql", "connection-string": "@env('CONN_B')" },
"autoentities": {
"def-b": {
"patterns": { "name": "b_{object}", "include": [ "dbo.TableTwo" ] },
"permissions": [ { "role": "anonymous", "actions": [ { "action": "read" } ] } ]
}
}
}
- Run validation:
dab validate -c dab-config.json
Expected behavior
Validation passes. The child file's autoentities is expanded into entities (with the b_ prefix), exactly as documented and as it works in the top-level file.
Actual behavior
Validation fails:
The config satisfies the schema requirements.
fail: Config '<child-config>.json': No entities found. At least one entity must be defined or discovered from autoentities when a data source is configured.
fail: Config is invalid.
Notes:
- Replacing the child's
autoentitieswith explicitentitiesmakes validation pass and the multi-database setup works correctly. - During an earlier (looser) run the child entities did appear in REST-path logging at runtime, yet schema validation still reported "No entities found" — suggesting the autoentities expansion is performed for the top-level config only and skipped for child configs at validation time.
Workaround
Define explicit entities in child configuration files instead of autoentities. Keep autoentities only in the top-level file.
Environment
- Data API builder: 2.0.8
- Database type: MSSQL (both data sources)
- OS: Windows
- Scenario: single DAB process serving two databases via
data-source-files, MCP enabled (stdio)
- Ngôn ngữ chính
- C#
- Star
- 1.5k
- Fork
- 371
- Merge trung bình
- 9 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/data-api-builder
-
pgsql
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Azure/data-api-builder#3598 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2.x cli mcp-server
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Azure/data-api-builder#3576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2.x health-endpoint
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Azure/data-api-builder#3570 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2.x telemetry
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Azure/data-api-builder#3564 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2.x telemetry
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Azure/data-api-builder#3562 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Azure/data-api-builder
Issue tương tự
-
area-System.Numerics.Tensors untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/runtime#134691 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
unoplatform/uno.templates#2277 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/fluentui-blazor#5344 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
difficulty/starter 🚀 good first issue kind/bug platform/all project/core-tools 🛠️ triage/untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
unoplatform/uno#24757 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci-failure-cause test-failure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày