44 * Licensed under the MIT License.
55 */
66
7- /* tslint:disable:no-unused */
7+ /* tslint:disable:no-unused */
88export * from './schema'
99import * as Validator from 'ajv'
1010import * as os from 'os'
@@ -67,7 +67,7 @@ export class Schema {
6767 let name = ppath . basename ( loc )
6868 return name . substring ( 0 , name . indexOf ( '.' ) )
6969 }
70-
70+
7171 /**
7272 * Path to this schema definition.
7373 */
@@ -174,7 +174,7 @@ export class Schema {
174174 */
175175 entityTypes ( ) : string [ ] {
176176 let found : string [ ] = [ ]
177- for ( let entity of Object . keys ( this . entities ( ) ) ) {
177+ for ( let entity of Object . keys ( this . entities ( ) ) ) {
178178 let [ entityName , _ ] = entity . split ( ':' )
179179 if ( ! found . includes ( entityName ) ) {
180180 found . push ( entityName )
@@ -187,7 +187,7 @@ export class Schema {
187187 * Return the roles or entity types found in schema.
188188 */
189189 * roles ( ) : Iterable < string > {
190- for ( let entity of Object . keys ( this . entities ( ) ) ) {
190+ for ( let entity of Object . keys ( this . entities ( ) ) ) {
191191 let [ entityName , role ] = entity . split ( ':' )
192192 yield role || entityName
193193 }
@@ -201,8 +201,11 @@ export class Schema {
201201 entities [ mapping ] = entity
202202 }
203203 }
204- for ( let prop of this . schemaProperties ( ) ) {
205- prop . addEntities ( entities )
204+ // Don't explore properties below an explicit mapping
205+ if ( ! this . schema . $mappings ) {
206+ for ( let prop of this . schemaProperties ( ) ) {
207+ prop . addEntities ( entities )
208+ }
206209 }
207210 }
208211}
0 commit comments