Skip to content

Commit ad9bd57

Browse files
committed
update
1 parent b610909 commit ad9bd57

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/language/src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,12 @@ function linkContentToContainer(node: AstNode): void {
186186
function validationAfterImportMerge(model: Model) {
187187
const errors: string[] = [];
188188
const dataSources = model.declarations.filter((d) => isDataSource(d));
189-
if (dataSources.length > 1) {
190-
errors.push('Validation error: Multiple datasource declarations are not allowed');
189+
if (dataSources.length === 0) {
190+
errors.push('Validation error: schema must have a datasource declaration');
191+
} else {
192+
if (dataSources.length > 1) {
193+
errors.push('Validation error: multiple datasource declarations are not allowed');
194+
}
191195
}
192196

193197
// at most one `@@auth` model

0 commit comments

Comments
 (0)