From 21b1fe73393508d84c90d00cc8f22aeaa958a2b5 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Thu, 20 Jul 2023 12:12:47 +1200 Subject: [PATCH] allow all keywords for custom draft specification (supports openapi project) --- JsonSchema/EvaluationOptions.cs | 2 +- JsonSchema/JsonSchema.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/JsonSchema/EvaluationOptions.cs b/JsonSchema/EvaluationOptions.cs index f7495b16e0..c9632f7dc6 100644 --- a/JsonSchema/EvaluationOptions.cs +++ b/JsonSchema/EvaluationOptions.cs @@ -200,7 +200,7 @@ private static IEnumerable AllowSiblingRef(IEnumerable FilterBySpecVersion(IEnumerable keywords, SpecVersion version) { - if (version == SpecVersion.Unspecified) return keywords; + if (!Enum.IsDefined(typeof(SpecVersion), version) || version == SpecVersion.Unspecified) return keywords; return keywords.Where(k => k.SupportsVersion(version)); } diff --git a/JsonSchema/JsonSchema.csproj b/JsonSchema/JsonSchema.csproj index cbc51047c9..648a8a51fc 100644 --- a/JsonSchema/JsonSchema.csproj +++ b/JsonSchema/JsonSchema.csproj @@ -16,8 +16,8 @@ https://github.com/gregsdennis/json-everything https://github.com/gregsdennis/json-everything json-schema validation schema json - 4.1.6 - 4.1.6.0 + 4.1.7 + 4.1.7.0 4.0.0.0 LICENSE JsonSchema.Net