![]() |
VOOZH | about |
JsonSchemaBuilder Class
Namespace: Json.Schema
Inheritance: JsonSchemaBuilder 🡒 object
A fluent-style builder for Json.Schema.JsonSchema.
| Name | Type | Summary |
|---|---|---|
| Empty | JsonSchemaBuilder | Gets an instance of Json.Schema.JsonSchemaBuilder that represents an empty JSON schema. |
| False | JsonSchemaBuilder | Gets a schema builder that always evaluates to false, representing a schema that does not match any JSON value. |
| True | JsonSchemaBuilder | Gets a schema builder that creates a schema which always validates as <see langword=”true” />. |
Initializes a new instance of the JsonSchemaBuilder class.
1
public JsonSchemaBuilder(BuildOptions buildOptions)
Use this constructor to create a new JsonSchemaBuilder for defining and constructing JSON schema objects. The builder can be configured with various schema properties and constraints before generating the final
Adds a new keyword with a value.
1
public void Add(string keyword, JsonNode value)
| Parameter | Type | Description |
|---|---|---|
| keyword | string | The keyword to add. |
| value | JsonNode | The value. |
Adds a new keyword with a nested schema.
1
public void Add(string keyword, JsonSchemaBuilder builder)
| Parameter | Type | Description |
|---|---|---|
| keyword | string | The keyword to add. |
| builder | JsonSchemaBuilder | Another builder. |
Adds a new keyword with a nested schema.
1
public void Add(string keyword, IEnumerable<JsonSchemaBuilder> builders)
| Parameter | Type | Description |
|---|---|---|
| keyword | string | The keyword to add. |
| builders | IEnumerable<JsonSchemaBuilder> | Another builder. |
Adds a new keyword with a nested schema.
1
public void Add(string keyword, IEnumerable<(string, JsonSchemaBuilder)> builders)
| Parameter | Type | Description |
|---|---|---|
| keyword | string | The keyword to add. |
| builders | IEnumerable<(string, JsonSchemaBuilder)> | Another builder. |
Adds a new keyword with a nested schema.
1
public void Add(string keyword, IEnumerable<KeyValuePair<string, JsonSchemaBuilder>> builders)
| Parameter | Type | Description |
|---|---|---|
| keyword | string | The keyword to add. |
| builders | IEnumerable<KeyValuePair<string, JsonSchemaBuilder>> | Another builder. |
Builds a JSON schema from the configured keywords and returns a corresponding Json.Schema.JsonSchema instance.
1
public JsonSchema Build(BuildOptions options, Uri baseUri)
| Parameter | Type | Description |
|---|---|---|
| options | BuildOptions | (Optional) Build options that control schema generation behavior. Overrides build options |
| baseUri | Uri | (Optional) A base URI to associate with the generated schema. If specified, it is used to resolve relative |
A Json.Schema.JsonSchema instance representing the constructed schema based on the provided options and base URI.
Creates a new Json.Schema.JsonSchema.
1
public static JsonSchemaBuilder RecursiveRefRoot()
A JSON Schema that simply refers back to the recursive root schema.
Creates a new Json.Schema.JsonSchema.
1
public static JsonSchemaBuilder RefRoot()
A JSON Schema that simply refers back to the root schema.
A new version of content is available.