diff --git a/src/ifcx-cli/ifcx-cli.ts b/src/ifcx-cli/ifcx-cli.ts index ae72393d..4511b57f 100644 --- a/src/ifcx-cli/ifcx-cli.ts +++ b/src/ifcx-cli/ifcx-cli.ts @@ -99,7 +99,7 @@ async function processArgs(args: string[]) new InMemoryLayerProvider().AddAll([userDefinedOrder, ...files]), ...providers ]); - let layerStack = await (new IfcxLayerStackBuilder(provider).FromId(userDefinedOrder.header.id)).Build(); + let layerStack = await (new IfcxLayerStackBuilder(provider).FromId(userDefinedOrder.header.id)).Build(validate); if (layerStack instanceof Error) { throw layerStack; diff --git a/src/ifcx-core/layers/layer-stack.ts b/src/ifcx-core/layers/layer-stack.ts index 7a2b78ce..d31945a3 100644 --- a/src/ifcx-core/layers/layer-stack.ts +++ b/src/ifcx-core/layers/layer-stack.ts @@ -11,10 +11,12 @@ export class IfcxLayerStack private tree: PostCompositionNode; private schemas: {[key:string]:IfcxSchema}; private federated: IfcxFile; + private checkSchemas: boolean; - constructor(layers: IfcxFile[]) + constructor(layers: IfcxFile[], checkSchemas: boolean = true) { this.layers = layers; + this.checkSchemas = checkSchemas; this.Compose(); } @@ -28,7 +30,7 @@ export class IfcxLayerStack this.federated = Federate(this.layers); // TODO: schema files this.schemas = this.federated.schemas; - this.tree = LoadIfcxFile(this.federated); + this.tree = LoadIfcxFile(this.federated, this.checkSchemas); } public GetFullTree() @@ -64,7 +66,7 @@ export class IfcxLayerStackBuilder return this; } - async Build(): Promise + async Build(checkSchemas: boolean = true): Promise { if (!this.mainLayerId) throw new Error(`no main layer ID specified`); @@ -77,7 +79,7 @@ export class IfcxLayerStackBuilder try { - return new IfcxLayerStack(layers); + return new IfcxLayerStack(layers, checkSchemas); } catch (e) {