@@ -33,14 +33,16 @@ const interpret = (unevaluatedProperties, instance, context) => {
3333const simpleApplicator = true ;
3434
3535const plugin = {
36- beforeSchema ( _url , _instance , context ) {
36+ beforeSchema ( _url , instance , context ) {
3737 context . evaluatedProperties ??= new Set ( ) ;
3838 context . schemaEvaluatedProperties = new Set ( ) ;
39+ context . instanceLocation ??= Instance . uri ( instance ) ;
3940 } ,
4041
41- beforeKeyword ( _node , _instance , context , schemaContext ) {
42+ beforeKeyword ( _node , instance , context , schemaContext ) {
4243 context . evaluatedProperties = new Set ( ) ;
4344 context . schemaEvaluatedProperties = schemaContext . schemaEvaluatedProperties ;
45+ context . instanceLocation = Instance . uri ( instance ) ;
4446 } ,
4547
4648 afterKeyword ( _node , _instance , context , _valid , schemaContext ) {
@@ -49,8 +51,8 @@ const plugin = {
4951 }
5052 } ,
5153
52- afterSchema ( _node , _instance , context , valid ) {
53- if ( valid ) {
54+ afterSchema ( _node , instance , context , valid ) {
55+ if ( valid && Instance . uri ( instance ) === context . instanceLocation ) {
5456 for ( const property of context . schemaEvaluatedProperties ) {
5557 context . evaluatedProperties . add ( property ) ;
5658 }
0 commit comments