Skip to content

Commit

Permalink
add extension methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsdennis committed May 26, 2022
1 parent fed19c4 commit 8c49206
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions JsonSchema/JsonSchemaBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,32 @@ public static JsonSchemaBuilder UniqueItems(this JsonSchemaBuilder builder, bool
return builder;
}

/// <summary>
/// Adds a keyword that's not recognized by any vocabulary - extra data - to the schema.
/// </summary>
/// <param name="builder">The builder.</param>
/// <param name="name">The keyword name.</param>
/// <param name="value">The value.</param>
/// <returns>The builder.</returns>
public static JsonSchemaBuilder Unrecognized(this JsonSchemaBuilder builder, string name, JsonElement value)
{
builder.Add(new UnrecognizedKeyword(name, value));
return builder;
}

/// <summary>
/// Adds a keyword that's not recognized by any vocabulary - extra data - to the schema.
/// </summary>
/// <param name="builder">The builder.</param>
/// <param name="name">The keyword name.</param>
/// <param name="value">The value.</param>
/// <returns>The builder.</returns>
public static JsonSchemaBuilder Unrecognized(this JsonSchemaBuilder builder, string name, JsonElementProxy value)
{
builder.Add(new UnrecognizedKeyword(name, value));
return builder;
}

/// <summary>
/// Add an `$vocabulary` keyword.
/// </summary>
Expand Down

0 comments on commit 8c49206

Please sign in to comment.