diff --git a/Solutions/Corvus.Json.Validator/JsonSchema.cs b/Solutions/Corvus.Json.Validator/JsonSchema.cs index 2a69c83a8..c35c1b259 100644 --- a/Solutions/Corvus.Json.Validator/JsonSchema.cs +++ b/Solutions/Corvus.Json.Validator/JsonSchema.cs @@ -39,7 +39,6 @@ public readonly struct JsonSchema """; private static readonly PrepopulatedDocumentResolver MetaschemaDocumentResolver = CreateMetaschemaDocumentResolver(); - private static readonly VocabularyRegistry VocabularyRegistry = RegisterVocabularies(MetaschemaDocumentResolver); private static readonly ConcurrentDictionary CachedSchema = []; #if NET8_0_OR_GREATER @@ -170,7 +169,9 @@ public ValidationContext Validate(JsonElement jsonElement, ValidationLevel level private static JsonSchema FromCore(string jsonSchemaUri, IDocumentResolver documentResolver, IVocabulary fallbackVocabulary, bool alwaysAssertFormat) { - JsonSchemaTypeBuilder typeBuilder = new(documentResolver, VocabularyRegistry); + VocabularyRegistry vocabularyRegistry = RegisterVocabularies(documentResolver); + + JsonSchemaTypeBuilder typeBuilder = new(documentResolver, vocabularyRegistry); TypeDeclaration rootType = typeBuilder.AddTypeDeclarations(