2929// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
3131
32- using Microsoft . Performance . SDK . Processing ;
33- using NJsonSchema ;
3432using System . Collections . Generic ;
3533using System . IO ;
3634using System . Linq ;
35+ using Microsoft . Performance . SDK . Processing ;
36+ using NJsonSchema ;
3737using WPAPlugin . Schemas ;
3838
3939namespace WPAPlugin
@@ -64,7 +64,7 @@ public override ProcessingSourceInfo GetAboutInfo()
6464 new ContactInfo
6565 {
6666 Name = "Alaaeddine Chakroun" ,
67- EmailAddresses = new [ ] { "alaaeddine.chakroun@daydevs.com" }
67+ EmailAddresses = new [ ] { "alaaeddine.chakroun@daydevs.com" }
6868 } ,
6969 } ,
7070 ProjectInfo = new ProjectInfo
@@ -92,6 +92,7 @@ ProcessorOptions options
9292
9393 timelinePathList . Clear ( ) ;
9494 countingPathList . Clear ( ) ;
95+ validationCache . Clear ( ) ;
9596 return new WperfCustomDataProcessorWithSourceParser (
9697 parser ,
9798 options ,
@@ -100,9 +101,8 @@ ProcessorOptions options
100101 ) ;
101102 }
102103
103-
104- private static Dictionary < ( string , string ) , bool > validationCache = new Dictionary < ( string , string ) , bool > ( ) ;
105-
104+ private static Dictionary < ( string , string ) , bool > validationCache =
105+ new Dictionary < ( string , string ) , bool > ( ) ;
106106
107107 private static bool ValidateJson ( string sourcePath , JsonSchemas . Schemas schema )
108108 {
@@ -111,7 +111,8 @@ private static bool ValidateJson(string sourcePath, JsonSchemas.Schemas schema)
111111 {
112112 return validationCache [ cacheKey ] ;
113113 }
114- var parsedSchema = JsonSchema . FromSampleJson ( JsonSchemas . GetSchemaByKey ( schema ) ) ;
114+ var selectedSchema = JsonSchemas . GetSchemaByKey ( schema ) ;
115+ var parsedSchema = JsonSchema . FromJsonAsync ( selectedSchema ) . Result ;
115116 var jsonContent = File . ReadAllText ( sourcePath ) ;
116117 var errors = parsedSchema . Validate ( jsonContent ) ;
117118
0 commit comments