Skip to content

Commit

Permalink
add site support for custom vocabs
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsdennis committed Sep 7, 2021
1 parent 3d9c066 commit efe234f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions JsonSchema.UniqueKeys/UniqueKeysKeyword.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ internal class UniqueKeysKeywordJsonConverter : JsonConverter<UniqueKeysKeyword>
{
public override UniqueKeysKeyword Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.StartObject)
throw new JsonException("Expected object");
if (reader.TokenType != JsonTokenType.StartArray)
throw new JsonException("Expected array");

var references = JsonSerializer.Deserialize<List<JsonPointer>>(ref reader, options);
return new UniqueKeysKeyword(references);
Expand Down
3 changes: 3 additions & 0 deletions TryJsonEverything/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ private static void ConfigureDefaults()
{
ValidationOptions.Default.DefaultBaseUri = new Uri("https://json-everything.net");
ValidationOptions.Default.OutputFormat = OutputFormat.Basic;

Json.Schema.Data.Vocabularies.Register();
Json.Schema.UniqueKeys.Vocabularies.Register();
}
}
}
2 changes: 2 additions & 0 deletions TryJsonEverything/TryJsonEverything.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<ProjectReference Include="..\JsonLogic\JsonLogic.csproj" />
<ProjectReference Include="..\JsonPatch\JsonPatch.csproj" />
<ProjectReference Include="..\JsonPath\JsonPath.csproj" />
<ProjectReference Include="..\JsonSchema.Data\JsonSchema.Data.csproj" />
<ProjectReference Include="..\JsonSchema.UniqueKeys\JsonSchema.UniqueKeys.csproj" />
<ProjectReference Include="..\JsonSchema\JsonSchema.csproj" />
</ItemGroup>

Expand Down

0 comments on commit efe234f

Please sign in to comment.