Skip to content

Commit

Permalink
Merge pull request #330 from gregsdennis/schema/absolute-schema-locat…
Browse files Browse the repository at this point in the history
…ion-fix

fix absolute schema location in output
  • Loading branch information
gregsdennis committed Sep 4, 2022
2 parents 59579ab + 8ff18d0 commit 7e1d8f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion JsonSchema/DynamicRefKeyword.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void Validate(ValidationContext context)
}

context.NavigatedReferences.Add(navigation);
context.Push(newUri: newUri);
context.Push(newUri: schema.BaseUri ?? newUri);
schema.ValidateSubschema(context);
var result = context.LocalResult.IsValid;
context.Pop();
Expand Down
1 change: 1 addition & 0 deletions JsonSchema/JsonSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public void RegisterSubschemas(SchemaRegistry registry, Uri currentUri)
var refKeyword = Keywords.OfType<RefKeyword>().SingleOrDefault();
var refMatters = refKeyword != null &&
(registry.ValidatingAs == Draft.Draft6 || registry.ValidatingAs == Draft.Draft7);
UpdateBaseUri(currentUri);
if (idKeyword != null && !refMatters)
{
currentUri = idKeyword.UpdateUri(currentUri);
Expand Down
4 changes: 2 additions & 2 deletions JsonSchema/JsonSchema.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<PackageProjectUrl>https://github.com/gregsdennis/json-everything</PackageProjectUrl>
<RepositoryUrl>https://github.com/gregsdennis/json-everything</RepositoryUrl>
<PackageTags>json-schema validation schema json</PackageTags>
<Version>3.2.0</Version>
<FileVersion>3.2.0.0</FileVersion>
<Version>3.2.1</Version>
<FileVersion>3.2.1.0</FileVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<AssemblyName>JsonSchema.Net</AssemblyName>
Expand Down
4 changes: 4 additions & 0 deletions json-everything.net/wwwroot/md/release-notes/json-schema.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [3.2.1](https://github.com/gregsdennis/json-everything/pull/330)

Fixed absolute schema location in output. The JSON Schema team identified some edge cases involving `$dynamicRef` where the wrong URI was reported.

# [3.2.0](https://github.com/gregsdennis/json-everything/pull/300)

Added `JsonSchemaBuilderExtensions.PatternProperties()` overloads that take strings in place of `Regex`es. There is no syntax highlighting support for these overloads, however.
Expand Down

0 comments on commit 7e1d8f5

Please sign in to comment.