### Examples (IEnumerable) Source: https://docs.json-everything.net/api/JsonSchema.Net/JsonSchemaBuilderExtensions Adds an 'examples' keyword to the schema with a collection of example JSON nodes. ```APIDOC ## Examples (IEnumerable) ### Description Adds an 'examples' keyword to the schema with a collection of example JSON nodes. ### Method `public static JsonSchemaBuilder Examples(this JsonSchemaBuilder builder, IEnumerable elements)` ### Parameters #### Path Parameters - **builder** (JsonSchemaBuilder) - The builder. - **elements** (IEnumerable) - The example values. ### Returns The builder. ``` -------------------------------- ### Examples (params JsonNode[]) Source: https://docs.json-everything.net/api/JsonSchema.Net/JsonSchemaBuilderExtensions Adds an 'examples' keyword to the schema with a variable number of example JSON nodes. ```APIDOC ## Examples (params JsonNode[]) ### Description Adds an 'examples' keyword to the schema with a variable number of example JSON nodes. ### Method `public static JsonSchemaBuilder Examples(this JsonSchemaBuilder builder, params JsonNode[] elements)` ### Parameters #### Path Parameters - **builder** (JsonSchemaBuilder) - The builder. - **elements** (params JsonNode[]) - The example values. ### Returns The builder. ``` -------------------------------- ### Example Source: https://docs.json-everything.net/api/JsonSchema.Net.OpenApi/JsonSchemaBuilderExtensions Adds an 'example' keyword to the schema. This keyword provides an example of an instance that conforms to the schema. ```APIDOC ## Example(this JsonSchemaBuilder builder, JsonNode value) ### Description Adds an `example` keyword. ### Method `public static JsonSchemaBuilder Example(this JsonSchemaBuilder builder, JsonNode value)` ### Parameters #### Path Parameters - **builder** (JsonSchemaBuilder) - The builder. - **value** (JsonNode) - The example value. ### Returns The builder. ``` -------------------------------- ### GetStart(this SubstrRule rule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the start index for a SubstrRule. ```APIDOC ## GetStart(this SubstrRule rule) ### Description Gets the rule that returns the start index. ### Method public static Rule GetStart(this SubstrRule rule) ### Parameters #### Path Parameters - **rule** (SubstrRule) - Required - The rule ``` -------------------------------- ### Add Examples to Schema (params) Source: https://docs.json-everything.net/api/JsonSchema.Net/JsonSchemaBuilderExtensions Adds an 'examples' keyword to the JSON schema using a params array of JsonNode. Use for a concise list of examples. ```csharp public static JsonSchemaBuilder Examples(this JsonSchemaBuilder builder, params JsonNode[] elements) ``` -------------------------------- ### Add Example Keyword to Schema Builder Source: https://docs.json-everything.net/api/JsonSchema.Net.OpenApi/JsonSchemaBuilderExtensions Use the Example method to add an example value to a schema. This helps in illustrating the expected structure and content of the data that conforms to the schema. ```csharp public static JsonSchemaBuilder Example(this JsonSchemaBuilder builder, JsonNode value) ``` -------------------------------- ### Add Examples to Schema (IEnumerable) Source: https://docs.json-everything.net/api/JsonSchema.Net/JsonSchemaBuilderExtensions Adds an 'examples' keyword to the JSON schema using an IEnumerable of JsonNode. Use when providing multiple examples. ```csharp public static JsonSchemaBuilder Examples(this JsonSchemaBuilder builder, IEnumerable elements) ``` -------------------------------- ### Instance examples for 'data' keyword validation Source: https://docs.json-everything.net/schema/vocabs/data-2023 These examples demonstrate passing, failing, and resolution failure scenarios for a schema using the 'data' keyword. Note that resolution failures halt further evaluation. ```json // passing { "bar": 5, "foo": 10 } { "foo": 10 } {} // failing { "bar": 5, "foo": 0 } // resolution failure { "bar": 20 } ``` -------------------------------- ### Instance examples for 'optionalData' keyword validation Source: https://docs.json-everything.net/schema/vocabs/data-2023 These examples illustrate passing, failing, and scenarios where 'foo' is absent when using the 'optionalData' keyword. Resolution failures are gracefully ignored. ```json // passing { "bar": 5, "foo": 10 } { "bar": 10 } { "foo": 10 } {} // failing { "bar": 5, "foo": 0 } ``` -------------------------------- ### Validate Instance Data with Data-Driven Minimum Source: https://docs.json-everything.net/schema/vocabs/data-2022 Examples of instance data demonstrating how the `foo` property's validation against the `minimum` (derived from `minValue`) changes based on the `minValue`'s value. The first example passes, while the second fails. ```json // passing { "minValue": 5, "foo": 10 } ``` ```json // failing { "minValue": 15, "foo": 10 } ``` -------------------------------- ### Operators Example Source: https://docs.json-everything.net/json-e/basics Shows how to use JSON-e operators, identified by keys starting with '$', to perform transformations like flattening arrays. ```APIDOC ## Operators ### Description Objects with keys starting with `$` are special operators. This example demonstrates the `$flatten` operator. ### Example ```csharp var template = JsonNode.Parse( "{\"$flatten\": [[1, 2], [3, 4], [5]]}" ); var result = JsonE.Evaluate(template); // result: [1, 2, 3, 4, 5] ``` ``` -------------------------------- ### Get Source: https://docs.json-everything.net/api/JsonSchema.Net/SchemaRegistry Gets a schema by URI ID and/or anchor from the registry. ```APIDOC ## Get(Uri uri) ### Description Gets a schema by URI ID and/or anchor. ### Method public IBaseDocument Get(Uri uri) ### Parameters #### Path Parameters - **uri** (Uri) - Required - The URI ID. ### Returns The schema, if registered in either this or the global registry; otherwise null. ``` -------------------------------- ### GetInitial Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the initial value. ```APIDOC ## GetInitial(this ReduceRule rule) ### Description Gets the rule that returns the initial value. ### Method `public static Rule GetInitial(this ReduceRule rule)` ### Parameters #### Path Parameters - **rule** (ReduceRule) - Required - The rule. ``` -------------------------------- ### Example of Minimum Validation Error Message Source: https://docs.json-everything.net/schema/basics This example shows how token replacement in the default 'minimum' error message template results in a specific error string. ```text 5 is less than or equal to 10 ``` -------------------------------- ### TryGet(string name, out IPathFunctionDefinition function) Source: https://docs.json-everything.net/api/JsonPath.Net/FunctionRepository Gets a function implementation by name. ```APIDOC ## TryGet(string name, out IPathFunctionDefinition function) ### Description Gets a function implementation by name. ### Method public static bool TryGet(string name, out IPathFunctionDefinition function) ### Parameters #### Path Parameters - **name** (string) - Required - A function name. - **function** (out IPathFunctionDefinition) - Required - The function, if found; otherwise null. ### Returns True if found; otherwise false. ``` -------------------------------- ### Get(string key) Source: https://docs.json-everything.net/api/JsonSchema.Net/Formats Retrieves a format by its key. Returns null if the format is not found. ```APIDOC ## Get(string key) Gets a format by its key. ### Declaration ```csharp public static Format Get(string key) ``` ### Parameters | Parameter | Type | Description | |---|---|---| | key | string | The key. | ### Returns The specified format, if known; otherwise null. ``` -------------------------------- ### Get Localized Error Message - C# Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Retrieves a localized error message string for a given key and culture. If the key starts with 'Get', the prefix is removed before lookup. Defaults to current culture if null. ```csharp public static string Get(CultureInfo culture, string key) ``` -------------------------------- ### Using JSON-e Operators Source: https://docs.json-everything.net/json-e/basics Special object keys starting with `$` are reserved for JSON-e operations. This example shows the `$flatten` operator to merge nested arrays. ```csharp var template = JsonNode.Parse( "{\"$flatten\": [[1, 2], [3, 4], [5]]}" ); var result = JsonE.Evaluate(template); // result: [1, 2, 3, 4, 5] ``` -------------------------------- ### ErrorMessages.Get Method Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Retrieves a localized error message string for a given key and culture. If the key starts with 'Get', the prefix is removed before lookup. This method is useful for obtaining user-facing error messages. ```APIDOC ## Get(CultureInfo culture, string key) ### Description Retrieves a localized error message string for the specified key and culture. ### Method Signature ```csharp public static string Get(CultureInfo culture, string key) ``` ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - The culture to use when retrieving the error message. If null, the default culture or the current thread’s culture is used. - **key** (string) - Required - The resource key identifying the error message to retrieve. If not specified, the caller’s member name is used. ### Returns A localized error message string corresponding to the specified key and culture. ### Remarks If the parameter begins with “Get”, that prefix is removed before looking up the resource. This method is typically used within error-handling code to retrieve user-facing error messages based on the key. ``` -------------------------------- ### Configure Build Options for JSON Schema Source: https://docs.json-everything.net/schema/basics Set up build options including dialect, schema registry, dialect registry, and vocabulary registry. All properties are optional. ```csharp var buildOptions = new BuildOptions { Dialect = Dialect.Draft202012, SchemaRegistry = new(), DialectRegistry = new(), VocabularyRegistry = new() } ``` -------------------------------- ### Generate Sample Data with Build Options Source: https://docs.json-everything.net/api/JsonSchema.Net.DataGeneration/JsonSchemaExtensions This overload allows generating sample data with custom build options. The 'options' parameter is currently not used. ```csharp public static GenerationResult GenerateData(this JsonSchema schema, BuildOptions options) ``` -------------------------------- ### Basic JsonLogic Rules Source: https://docs.json-everything.net/logic/basics Examples of simple JsonLogic rules for comparison and array operations. ```json {"<" : [1, 2]} ``` ```json {"merge":[ [1,2], [3,4] ]} ``` ```json {"in": [ "Ringo", ["John", "Paul", "George", "Ringo"] ]} ``` -------------------------------- ### ExampleKeyword Class Methods Source: https://docs.json-everything.net/api/JsonSchema.Net.OpenApi/ExampleKeyword This section details the methods available in the ExampleKeyword class for handling OpenAPI 'example' keywords. ```APIDOC ## BuildSubschemas(KeywordData keyword, BuildContext context) ### Description Builds and registers subschemas based on the specified keyword data within the provided build context. ### Declaration ```csharp public virtual void BuildSubschemas(KeywordData keyword, BuildContext context) ``` ### Parameters #### keyword - **Type**: KeywordData - **Description**: The keyword data used to determine which subschemas to build. Cannot be null. #### context - **Type**: BuildContext - **Description**: The context in which subschemas are constructed and registered. Cannot be null. ``` ```APIDOC ## Evaluate(KeywordData keyword, EvaluationContext context) ### Description Evaluates the specified keyword using the provided evaluation context and returns the result of the evaluation. ### Declaration ```csharp public virtual KeywordEvaluation Evaluate(KeywordData keyword, EvaluationContext context) ``` ### Parameters #### keyword - **Type**: KeywordData - **Description**: The keyword data to be evaluated. Cannot be null. #### context - **Type**: EvaluationContext - **Description**: The context in which the keyword evaluation is performed. Cannot be null. ### Returns A KeywordEvaluation object containing the results of the evaluation. ``` ```APIDOC ## ValidateKeywordValue(JsonElement value) ### Description Validates the specified JSON element as a keyword value and optionally returns a value to be shared across the other methods. ### Declaration ```csharp public virtual object ValidateKeywordValue(JsonElement value) ``` ### Parameters #### value - **Type**: JsonElement - **Description**: The JSON element to validate and convert. Represents the value to be checked for keyword compliance. ### Returns An object that is shared with the other methods. This object is saved to**Json.Schema.KeywordData.Value**. ``` -------------------------------- ### GetAttributes Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation/ContextExtensions Gets the attribute set. Type contexts get type attributes; member context get member attributes. ```APIDOC ## GetAttributes(this SchemaGenerationContextBase context) ### Description Gets the attribute set. Type contexts get type attributes; member context get member attributes. ### Method Signature public static IEnumerable GetAttributes(this SchemaGenerationContextBase context) ### Parameters #### Path Parameters - **context** (SchemaGenerationContextBase) - Required - The context. ### Returns The attribute set. ``` -------------------------------- ### AnyOfIntent Constructors Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation/AnyOfIntent Demonstrates how to instantiate the AnyOfIntent class using different overloads. ```APIDOC ## AnyOfIntent Constructors ### AnyOfIntent(IEnumerable> subschemas) Creates a new instance of the Json.Schema.Generation.Intents.AnyOfIntent class. #### Parameters - **subschemas** (IEnumerable>) - The subschemas to include. ### AnyOfIntent(params IEnumerable[] subschemas) Creates a new instance of the Json.Schema.Generation.Intents.AnyOfIntent class. #### Parameters - **subschemas** (params IEnumerable[]) - The subschemas to include. ``` -------------------------------- ### Format Constructor Source: https://docs.json-everything.net/api/JsonSchema.Net/Format Creates a new instance of the Format class. ```APIDOC ## Format(string key) ### Description Creates a new instance of the Json.Schema.Format class. ### Parameters #### Path Parameters - **key** (string) - Required - The format key. ### Method Signature public Format(string key) ``` -------------------------------- ### BuildContext.From Method Source: https://docs.json-everything.net/api/JsonSchema.Net/BuildContext Creates a copy of a build context from the one that was used to build a keyword. ```APIDOC ## From(KeywordData keyword) ### Description Creates a copy of a build context from the one that was used to build a keyword. ### Method public static BuildContext From(KeywordData keyword) ### Parameters #### Path Parameters - **keyword** (KeywordData) - Required - The keyword. ### Returns A copy of the build context. ``` -------------------------------- ### Register OpenAPI v3.1 Vocabulary Source: https://docs.json-everything.net/schema/vocabs/openapi Include this in your startup logic to register the OpenAPI v3.1 vocabulary. Optionally, pass build options to target specific registries. ```csharp Json.Schema.OpenApi.MetaSchemas.Register(); ``` -------------------------------- ### Get Raw Span Representation of JsonPointerSegment Source: https://docs.json-everything.net/api/JsonPointer.Net/JsonPointerSegment Use the AsSpan method to get the raw ReadOnlySpan representation of a JSON Pointer segment. ```csharp public ReadOnlySpan AsSpan() ``` -------------------------------- ### Build Schema using Draft 7 Equivalents Source: https://docs.json-everything.net/schema/examples/version-selection This code constructs a schema using keywords compatible with Draft 7, such as array-valued `items` and `additionalItems`. This approach is necessary when targeting older drafts that do not support keywords like `prefixItems`. ```csharp JsonSchema schema = new JsonSchemaBuilder() .Type(SchemaValueType.Array) .Items( new JsonSchemaBuilder() .Type(SchemaValueType.Integer), new JsonSchemaBuilder() .Type(SchemaValueType.Boolean) ) .AdditionalItems(new JsonSchemaBuilder() .Type(SchemaValueType.String) ) ``` -------------------------------- ### Generated JSON Patch Example Source: https://docs.json-everything.net/patch/basics An example of a JSON Patch generated to transform one JSON document into another. This patch can be applied to verify the transformation. ```json [ {"op":"replace","path":"/1/test","value":"test32132"}, {"op":"remove","path":"/2/test"}, {"op":"add","path":"/2/test1","value":"test321"}, {"op":"replace","path":"/3/test/2","value":3}, {"op":"add","path":"/4","value":{"test":[1,2,3]}} ] ``` -------------------------------- ### Substr(Rule input, Rule start) Source: https://docs.json-everything.net/api/JsonLogic/JsonLogic Creates a `substr` (concatenation) rule. This rule extracts a substring from the input rule starting at the specified position. ```APIDOC ## Substr(Rule input, Rule start) ### Description Creates a `substr` (concatenation) rule. This rule extracts a substring from the input rule starting at the specified position. ### Method Signature ```csharp public static Rule Substr(Rule input, Rule start) ``` ### Parameters - **input** (Rule) - The input rule. - **start** (Rule) - The start rule. ### Returns A `substr` rule. ``` -------------------------------- ### MinLengthKeyword Class Overview Source: https://docs.json-everything.net/api/JsonSchema.Net/MinLengthKeyword Provides details about the MinLengthKeyword class, its namespace, inheritance, and the 'minLength' keyword it handles. ```APIDOC ## MinLengthKeyword Class **Namespace:** Json.Schema.Keywords **Inheritance:** `MinLengthKeyword` 🡒 `object` **Implemented interfaces:** * IKeywordHandler Handles `minLength`. ### Remarks This keyword specifies the minimum length of a string. ``` -------------------------------- ### Apply Method Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation.DataAnnotations/RangeAttributeHandler Applies constraints for source generation. Returns the builder for chaining. ```APIDOC ## Apply(JsonSchemaBuilder builder, object minimum, object maximum) ### Description Applies constraints for source generation. ### Method Signature ```csharp public static JsonSchemaBuilder Apply(JsonSchemaBuilder builder, object minimum, object maximum) ``` ### Parameters #### builder - **Type**: JsonSchemaBuilder - **Description**: The schema builder. #### minimum - **Type**: object - **Description**: The minimum value. #### maximum - **Type**: object - **Description**: The maximum value. ### Returns - **Type**: JsonSchemaBuilder - **Description**: The builder for chaining. ``` -------------------------------- ### Initialize Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation/JsonSchemaSourceGenerator Initializes the incremental generator. ```APIDOC ## Initialize(IncrementalGeneratorInitializationContext context) ### Description Initializes the incremental generator. ### Method `public void Initialize(IncrementalGeneratorInitializationContext context)` ``` -------------------------------- ### Substr(Rule input, Rule start, Rule count) Source: https://docs.json-everything.net/api/JsonLogic/JsonLogic Creates a `substr` (concatenation) rule. This rule extracts a substring from the input rule starting at the specified position with a given count. ```APIDOC ## Substr(Rule input, Rule start, Rule count) ### Description Creates a `substr` (concatenation) rule. This rule extracts a substring from the input rule starting at the specified position with a given count. ### Method Signature ```csharp public static Rule Substr(Rule input, Rule start, Rule count) ``` ### Parameters - **input** (Rule) - The input rule. - **start** (Rule) - The start rule. - **count** (Rule) - The count rule. ### Returns A `substr` rule. ``` -------------------------------- ### DescriptionIntent Constructor Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation/DescriptionIntent Creates a new instance of the DescriptionIntent class with a specified description value. ```APIDOC ## DescriptionIntent(string value) ### Description Creates a new Json.Schema.Generation.Intents.DescriptionIntent instance. ### Parameters #### Path Parameters - **value** (string) - Required - The value of the description. ``` -------------------------------- ### GetCondition Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the condition. ```APIDOC ## GetCondition(this IfRule rule) ### Description Gets the rule that returns the condition. ### Method `public static Rule GetCondition(this IfRule rule)` ### Parameters #### Path Parameters - **rule** (IfRule) - Required - The rule. ``` -------------------------------- ### GetUnknownFormat Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for an unknown format. ```APIDOC ## GetUnknownFormat(CultureInfo culture) ### Description Gets the error message for an unknown format. ### Method Signature public static string GetUnknownFormat(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - The culture to retrieve. ### Remarks Available tokens are: * [[format]] - the format key ``` -------------------------------- ### PredicateFormat Constructors Source: https://docs.json-everything.net/api/JsonSchema.Net/PredicateFormat Demonstrates how to create new instances of the PredicateFormat class using different predicate types. ```APIDOC ## PredicateFormat(string key, Func predicate) ### Description Creates a new `Json.Schema.PredicateFormat` using a string key and a function predicate. ### Parameters - **key** (string) - Required - The format key. - **predicate** (Func) - Required - The predicate function for validation. ``` ```APIDOC ## PredicateFormat(string key, PredicateWithErrorMessage predicate) ### Description Creates a new `Json.Schema.PredicateFormat` using a string key and a `PredicateWithErrorMessage` object. ### Parameters - **key** (string) - Required - The format key. - **predicate** (PredicateWithErrorMessage) - Required - The predicate object containing the validation logic and error message. ``` -------------------------------- ### Instantiate SchemaGeneratorConfiguration Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation/SchemaGeneratorConfiguration Creates a new instance of the SchemaGeneratorConfiguration class. This is the default constructor. ```csharp public SchemaGeneratorConfiguration() ``` -------------------------------- ### GetElse Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the else requirement. ```APIDOC ## GetElse(this IfRule rule) ### Description Gets the rule that returns the else requirement. ### Method `public static Rule GetElse(this IfRule rule)` ### Parameters #### Path Parameters - **rule** (IfRule) - Required - The rule. ``` -------------------------------- ### GetDefault Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the default value. ```APIDOC ## GetDefault(this VariableRule rule) ### Description Gets the rule that returns the default value. ### Method `public static Rule GetDefault(this VariableRule rule)` ### Parameters #### Path Parameters - **rule** (VariableRule) - Required - The rule. ``` -------------------------------- ### Create a Custom Dialect with a New Keyword Source: https://docs.json-everything.net/schema/custom-keywords Example of creating a custom dialect by extending an existing one (Draft202012) and including a custom keyword (Mykeyword). ```csharp var myDialect = Dialect.Draft202012.With([Mykeyword.Instance]); var buildOptions = new BuildOptions { Dialect = myDialect } ``` -------------------------------- ### GetCount Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the character count. ```APIDOC ## GetCount(this SubstrRule rule) ### Description Gets the rule that returns the character count. ### Method `public static Rule GetCount(this SubstrRule rule)` ### Parameters #### Path Parameters - **rule** (SubstrRule) - Required - The rule. ``` -------------------------------- ### Create BuildContext from Keyword Source: https://docs.json-everything.net/api/JsonSchema.Net/BuildContext Creates a copy of the build context from the one used to build a keyword. This is useful for maintaining context during schema processing. ```csharp public static BuildContext From(KeywordData keyword) ``` -------------------------------- ### Create a JSON Schema Bundle Source: https://docs.json-everything.net/schema/bundling Use `SchemaRegistry.CreateBundle()` to create a single schema document containing the root schema and all referenced schemas. Ensure the root schema and all its references are available in the `SchemaRegistry` before calling this method. Dynamic and recursive references are not supported. ```csharp var bundled = SchemaRegistry.Global.CreateBundle( new Uri("https://schemas.example.com/person"), new Uri("https://schemas.example.com/person.bundle") ); if (bundled is null) throw new InvalidOperationException("Root schema was not found."); ``` -------------------------------- ### AsSpan() Source: https://docs.json-everything.net/api/JsonPointer.Net/JsonPointerSegment Gets the raw span representation of this segment. ```APIDOC ## AsSpan() ### Description Gets the raw span representation of this segment. ### Declaration ```csharp public ReadOnlySpan AsSpan() ``` ### Returns The segment as a ReadOnlySpan. ``` -------------------------------- ### GetUniqueItems Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.UniqueItemsKeyword for a specific culture. ```APIDOC ## GetUniqueItems(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.UniqueItemsKeyword for a specific culture. ### Method Signature public static string GetUniqueItems(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - The culture to retrieve. ### Remarks Available tokens are: * [[duplicates]] - the indices of duplicate pairs as a comma-delimited list of “(x, y)” items ``` -------------------------------- ### Dynamically Download External Schemas Source: https://docs.json-everything.net/schema/examples/external-schemas Set up an automatic download function for external schemas by assigning a custom method to the SchemaRegistry.Global.Fetch property. This is useful for schemas not preloaded. ```csharp JsonSchema? DownloadSchema(Uri uri) { try { var content = new HttpClient().GetStringAsync(uri).Result; return JsonSchema.FromText(content); } catch (Exception e) { return null; } } SchemaRegistry.Global.Fetch = DownloadSchema; ``` -------------------------------- ### GetType Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.TypeKeyword for a specific culture. ```APIDOC ## GetType(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.TypeKeyword for a specific culture. ### Method Signature public static string GetType(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - The culture to retrieve. ### Remarks Available tokens are: * [[received]] - the type of value provided in the JSON instance * [[expected]] - the type(s) required by the schema ``` -------------------------------- ### Create an All Rule Source: https://docs.json-everything.net/api/JsonLogic/JsonLogic Use the All method to create an 'all' rule, which checks if a predicate is true for all elements in an input. ```csharp public static Rule All(Rule input, Rule rule) ``` -------------------------------- ### GetRequired Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.RequiredKeyword for a specific culture. ```APIDOC ## GetRequired(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.RequiredKeyword for a specific culture. ### Method Signature public static string GetRequired(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - The culture to retrieve. ### Remarks Available tokens are: * [[missing]] - the properties missing from the JSON instance ``` -------------------------------- ### UnknownFormat Constructor Source: https://docs.json-everything.net/api/JsonSchema.Net/UnknownFormat Creates a new instance of the UnknownFormat class, initializing it with a specified format key. ```APIDOC ## UnknownFormat(string key) ### Description Creates a new Json.Schema.UnknownFormat instance. ### Parameters #### Path Parameters - **key** (string) - Required - The key representing the unknown format. ``` -------------------------------- ### GetPattern Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.PatternKeyword for a specific culture. ```APIDOC ## GetPattern(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.PatternKeyword for a specific culture. ### Method Signature public static string GetPattern(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - The culture to retrieve. ### Remarks Available tokens are: * [[pattern]] - the regular expression ``` -------------------------------- ### Format Class Constructor Source: https://docs.json-everything.net/api/JsonSchema.Net/Format Creates a new Json.Schema.Format instance with the specified key. This is used to define a custom format. ```csharp public Format(string key) ``` -------------------------------- ### GetOneOf Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.OneOfKeyword for a specific culture. ```APIDOC ## GetOneOf(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.OneOfKeyword for a specific culture. ### Method Signature public static string GetOneOf(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - The culture to retrieve. ### Remarks Available tokens are: * [[count]] - the number of subschemas that passed validation ``` -------------------------------- ### MinimumKeyword Class Overview Source: https://docs.json-everything.net/api/JsonSchema.Net/MinimumKeyword Provides an overview of the MinimumKeyword class, its namespace, inheritance, implemented interfaces, and the 'minimum' keyword it handles. ```APIDOC ## MinimumKeyword Class **Namespace:** Json.Schema.Keywords **Inheritance:** `MinimumKeyword` 🡒 `object` **Implemented interfaces:** * IKeywordHandler Handles `minimum`. ## Remarks This keyword specifies that a numeric instance must be greater than or equal to the value of the keyword. ``` -------------------------------- ### GetOneOf Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.OneOfKeyword for a specific culture. ```APIDOC ## GetOneOf(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.OneOfKeyword for a specific culture. ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - ### Remarks Available tokens are: * [[received]] - the value provided in the JSON instance * [[limit]] - the upper limit in the schema ``` -------------------------------- ### GetMaximum Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.MinimumKeyword for a specific culture. ```APIDOC ## GetMaximum(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.MinimumKeyword for a specific culture. ### Method Signature public static string GetMaximum(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - The culture to retrieve. ### Remarks Available tokens: * [[received]] - the value provided in the JSON instance * [[limit]] - the upper limit in the schema ``` -------------------------------- ### DescriptionIntent Constructor Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation/DescriptionIntent Use this constructor to create a new instance of DescriptionIntent, specifying the string value for the description keyword. ```csharp public DescriptionIntent(string value) ``` -------------------------------- ### GetFormat Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.FormatKeyword for a specific culture. ```APIDOC ## GetFormat(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.FormatKeyword for a specific culture. ### Method Signature public static string GetFormat(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - The culture to retrieve. ### Remarks Available tokens: * [[format]] - the format key ``` -------------------------------- ### Register Vocabularies Globally Source: https://docs.json-everything.net/schema/examples/setup Call `Vocabularies.Register()` at application startup to globally register keywords, meta-schemas, and vocabularies. This makes them available for use throughout the application. Optional parameters can be provided for specific registries if global registration is not desired. ```csharp using Json.Schema.Data; Vocabularies.Register(); ``` -------------------------------- ### GetExclusiveMinimum Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.ExclusiveMinimumKeyword for a specific culture. ```APIDOC ## GetExclusiveMinimum(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.ExclusiveMinimumKeyword for a specific culture. ### Method Signature public static string GetExclusiveMinimum(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - The culture to retrieve. ### Remarks Available tokens: * [[received]] - the value provided in the JSON instance * [[limit]] - the lower limit in the schema ``` -------------------------------- ### ToList() Method Source: https://docs.json-everything.net/api/JsonSchema.Net/EvaluationResults Transforms the results to the `basic` format. ```APIDOC ### ToList() Transforms the results to the`basic` format. #### Declaration ```csharp public void ToList() ``` ``` -------------------------------- ### GetExclusiveMaximum Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.ExclusiveMaximumKeyword for a specific culture. ```APIDOC ## GetExclusiveMaximum(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.ExclusiveMaximumKeyword for a specific culture. ### Method Signature public static string GetExclusiveMaximum(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - The culture to retrieve. ### Remarks Available tokens: * [[received]] - the value provided in the JSON instance * [[limit]] - the upper limit in the schema ``` -------------------------------- ### DescriptionKeyword Class Overview Source: https://docs.json-everything.net/api/JsonSchema.Net/DescriptionKeyword Provides an overview of the DescriptionKeyword class, its namespace, inheritance, and implemented interfaces. ```APIDOC ## DescriptionKeyword Class **Namespace:** Json.Schema.Keywords **Inheritance:** `DescriptionKeyword` 🡒 `object` **Implemented interfaces:** * IKeywordHandler Handles `description`. ### Remarks This keyword is used to provide a human-readable description of a schema. It has no validation effect but produces an annotation. ``` -------------------------------- ### GetEnum Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.EnumKeyword for a specific culture. ```APIDOC ## GetEnum(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.EnumKeyword for a specific culture. ### Method Signature public static string GetEnum(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - The culture to retrieve. ### Remarks Available tokens: * [[received]] - the value provided in the JSON instance * [[values]] - the available values in the schema The default messages are static and do not use these tokens as enum values may be any JSON type and could be quite large. They are provided to support custom messages. ``` -------------------------------- ### Create Method Source: https://docs.json-everything.net/api/JsonE.Net/JsonFunction Creates a new Json.JsonE.JsonFunction instance from a delegate. ```APIDOC ## Create(JsonFunctionDelegate function) ### Description Creates a new **Json.JsonE.JsonFunction**. ### Declaration ```csharp public static JsonFunction Create(JsonFunctionDelegate function) ``` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Parameters Table | Parameter | Type | Description | |---|---|---| | function | JsonFunctionDelegate | | ### Request Example - None ### Response #### Success Response (200) - **JsonFunction**: A new instance of JsonFunction. ### Response Example - None ``` -------------------------------- ### GetDependentSchemas Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.DependentSchemasKeyword for a specific culture. ```APIDOC ## GetDependentSchemas(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.DependentSchemasKeyword for a specific culture. ### Method Signature public static string GetDependentSchemas(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - The culture to retrieve. ### Remarks Available tokens: * [[value]] - the value in the schema ``` -------------------------------- ### MaxItemsKeyword Class Overview Source: https://docs.json-everything.net/api/JsonSchema.Net/MaxItemsKeyword Provides details about the MaxItemsKeyword class, its namespace, inheritance, and implemented interfaces. ```APIDOC ## Class: MaxItemsKeyword **Namespace:** Json.Schema.Keywords **Inheritance:** `MaxItemsKeyword` 🡒 `object` **Implemented interfaces:** * IKeywordHandler Handles `maxItems`. ### Remarks This keyword specifies the maximum number of items in an array. ``` -------------------------------- ### GetDependentRequired Source: https://docs.json-everything.net/api/JsonSchema.Net/ErrorMessages Gets the error message for Json.Schema.Keywords.DependentRequiredKeyword for a specific culture. ```APIDOC ## GetDependentRequired(CultureInfo culture) ### Description Gets the error message for Json.Schema.Keywords.DependentRequiredKeyword for a specific culture. ### Method Signature public static string GetDependentRequired(CultureInfo culture) ### Parameters #### Path Parameters - **culture** (CultureInfo) - Required - The culture to retrieve. ### Remarks Available tokens: * [[missing]] - the value in the schema ``` -------------------------------- ### UnknownFormat Constructor Source: https://docs.json-everything.net/api/JsonSchema.Net/UnknownFormat Creates a new Json.Schema.UnknownFormat instance with the specified format key. ```csharp public UnknownFormat(string key) ``` -------------------------------- ### GetPath for VariableRule Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the path for a VariableRule. ```APIDOC ## GetPath(this VariableRule rule) ### Description Gets the rule that returns the path. ### Method Extension Method ### Parameters #### Path Parameters - **rule** (VariableRule) - Required - The rule ``` -------------------------------- ### EnumIntent Constructors Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation/EnumIntent Demonstrates the different ways to instantiate the EnumIntent class to define enumeration values. ```APIDOC ## EnumIntent(IEnumerable names) ### Description Creates a new Json.Schema.Generation.Intents.EnumIntent instance with string names. ### Parameters - **names** (IEnumerable) - The names defined by the enumeration. ### Code Example ```csharp public EnumIntent(IEnumerable names) ``` ``` ```APIDOC ## EnumIntent(params string[] names) ### Description Creates a new Json.Schema.Generation.Intents.EnumIntent instance with a variable number of string names. ### Parameters - **names** (params string[]) - The names defined by the enumeration. ### Code Example ```csharp public EnumIntent(params string[] names) ``` ``` ```APIDOC ## EnumIntent(IEnumerable values) ### Description Creates a new Json.Schema.Generation.Intents.EnumIntent instance with JsonNode values. ### Parameters - **values** (IEnumerable) - The values defined by the enumeration. ### Code Example ```csharp public EnumIntent(IEnumerable values) ``` ``` ```APIDOC ## EnumIntent(params JsonNode[] values) ### Description Creates a new Json.Schema.Generation.Intents.EnumIntent instance with a variable number of JsonNode values. ### Parameters - **values** (params JsonNode[]) - The values defined by the enumeration. ### Code Example ```csharp public EnumIntent(params JsonNode[] values) ``` ``` -------------------------------- ### GetSegment(int index) Source: https://docs.json-everything.net/api/JsonPointer.Net/JsonPointer Gets a segment from the pointer by index. ```APIDOC ### GetSegment(int index) Gets a segment from the pointer by index. ``` -------------------------------- ### Vocabulary Constructor Source: https://docs.json-everything.net/api/JsonSchema.Net/Vocabulary Initializes a new instance of the Vocabulary class with a specified identifier and keyword handlers. ```APIDOC ## Vocabulary(Uri id, IEnumerable keywords) ### Description Initializes a new instance of the Vocabulary class with the specified identifier and keyword handlers. ### Parameters #### Path Parameters - **id** (Uri) - Required - The unique identifier for the vocabulary. Cannot be null. - **keywords** (IEnumerable) - Required - One or more collections of keyword handlers to associate with the vocabulary. ### Remarks All provided keyword handler collections are combined into a single set for the vocabulary. ``` -------------------------------- ### GetParent(int levels) Source: https://docs.json-everything.net/api/JsonPointer.Net/JsonPointer Gets the parent pointer of this pointer. ```APIDOC ### GetParent(int levels) Gets the parent pointer of this pointer. #### Declaration __ ```` public JsonPointer? GetParent(int levels) ```` Parameter| Type| Description ---|---|--- levels| int| The number of ancestor levels to go back. Defaults to 1. #### Returns __ The parent pointer, or null if this is the root pointer ``` -------------------------------- ### RefIntent Constructor with Uri Source: https://docs.json-everything.net/api/JsonSchema.Net.Generation/RefIntent Initializes a new instance of the RefIntent class with a specified reference URI. Use this constructor when you need to define a $ref keyword pointing to a specific URI. ```csharp public RefIntent(Uri reference) ``` -------------------------------- ### GetInput (SomeRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the input for a SomeRule. ```APIDOC ## GetInput(this SomeRule rule) ### Description Gets the rule that returns the input. ### Method `public static Rule GetInput(this SomeRule rule)` ### Parameters #### Path Parameters - **rule** (SomeRule) - Required - The rule. ``` -------------------------------- ### Configure Build Options with Custom Dialect in C# Source: https://docs.json-everything.net/schema/examples/custom-keywords Sets up the build options for schema validation to use the newly created custom dialect. This ensures that the custom keywords defined in the dialect are recognized during schema building. ```csharp var options = new BuildOptions { Dialect = myDialect } ``` -------------------------------- ### GetInput (ReduceRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the input for a ReduceRule. ```APIDOC ## GetInput(this ReduceRule rule) ### Description Gets the rule that returns the input. ### Method `public static Rule GetInput(this ReduceRule rule)` ### Parameters #### Path Parameters - **rule** (ReduceRule) - Required - The rule. ``` -------------------------------- ### GetInput (NoneRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the input for a NoneRule. ```APIDOC ## GetInput(this NoneRule rule) ### Description Gets the rule that returns the input. ### Method `public static Rule GetInput(this NoneRule rule)` ### Parameters #### Path Parameters - **rule** (NoneRule) - Required - The rule. ``` -------------------------------- ### GetInput (MapRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the input for a MapRule. ```APIDOC ## GetInput(this MapRule rule) ### Description Gets the rule that returns the input. ### Method `public static Rule GetInput(this MapRule rule)` ### Parameters #### Path Parameters - **rule** (MapRule) - Required - The rule. ``` -------------------------------- ### Schema with $ref and $defs Source: https://docs.json-everything.net/schema/schemagen/schema-generation Example of a generated schema where a common subschema (listOfString) is placed in $defs and referenced using $ref. ```json { "type": "object", "properties": { "foo": { "$ref": "#/$defs/listOfString" } }, "$defs": { "listOfString": { "type": "array", "items": { "type": "string" } } } } ``` -------------------------------- ### GetInput (FilterRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the input for a FilterRule. ```APIDOC ## GetInput(this FilterRule rule) ### Description Gets the rule that returns the input. ### Method `public static Rule GetInput(this FilterRule rule)` ### Parameters #### Path Parameters - **rule** (FilterRule) - Required - The rule. ``` -------------------------------- ### Load JsonSchema from File Source: https://docs.json-everything.net/api/JsonSchema.Net/JsonSchema Loads and builds a JsonSchema from a specified file. The filename should not be URL-encoded as System.Uri attempts to encode it. Use this for schemas stored in local files. ```csharp public static JsonSchema FromFile(string fileName, BuildOptions options, Uri baseUri) ``` -------------------------------- ### GetInput (AllRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the input for an AllRule. ```APIDOC ## GetInput(this AllRule rule) ### Description Gets the rule that returns the input. ### Method `public static Rule GetInput(this AllRule rule)` ### Parameters #### Path Parameters - **rule** (AllRule) - Required - The rule. ``` -------------------------------- ### Dialect Constructors Source: https://docs.json-everything.net/api/JsonSchema.Net/Dialect Initializes a new instance of the Dialect class using the specified collection of keyword handlers. ```APIDOC ## Dialect(IEnumerable keywords) ### Description Initializes a new instance of the Dialect class using the specified collection of keyword handlers. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Parameters - **keywords** (IEnumerable) - Required - A collection of keyword handlers to be included in the dialect. Each handler defines the behavior and metadata for the keyword. ### Remarks The provided keyword handlers are used to configure the dialect’s keyword metadata and dependency. ``` -------------------------------- ### DependenciesKeyword Class Overview Source: https://docs.json-everything.net/api/JsonSchema.Net/DependenciesKeyword Provides an overview of the DependenciesKeyword class, its namespace, inheritance, and implemented interfaces. ```APIDOC ## DependenciesKeyword Class **Namespace:** Json.Schema.Keywords.Draft06 **Inheritance:** `DependenciesKeyword` 🡒 `object` **Implemented interfaces:** * IKeywordHandler Handles `dependencies`. ## Remarks This keyword defines requirements for an object instance on the condition that given properties are present. If a property is present, then its value represents a requirement. That requirement may be an array of other required properties or a subschema that the instance (the full object, not the value of the property) must pass. ``` -------------------------------- ### GetDivisor (ModRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the divisor for a ModRule. ```APIDOC ## GetDivisor(this ModRule rule) ### Description Gets the rule that returns the divisor. ### Method `public static Rule GetDivisor(this ModRule rule)` ### Parameters #### Path Parameters - **rule** (ModRule) - Required - The rule. ``` -------------------------------- ### StartsWith Source: https://docs.json-everything.net/api/JsonPointer.Net/JsonPointer Determines if the current JSON Pointer begins with another specified JSON Pointer. ```APIDOC ## StartsWith(JsonPointer other) ### Description Determines whether the current JSON pointer starts with the specified JSON pointer. ### Method Signature public bool StartsWith(JsonPointer other) ### Parameters #### Path Parameters - **other** (JsonPointer) - The JSON pointer to compare with the beginning of the current pointer. Cannot be null. ### Returns true if the current JSON pointer starts with the specified pointer; otherwise, false. ``` -------------------------------- ### GetDivisor (DivideRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the divisor for a DivideRule. ```APIDOC ## GetDivisor(this DivideRule rule) ### Description Gets the rule that returns the divisor. ### Method `public static Rule GetDivisor(this DivideRule rule)` ### Parameters #### Path Parameters - **rule** (DivideRule) - Required - The rule. ``` -------------------------------- ### Standard Conditional Logic with Separate Groups Source: https://docs.json-everything.net/schema/examples/multiple-ifs-one-group Illustrates the standard approach using separate condition groups for 'white' and 'black' exterior colors, each applying a 'gray' interior constraint. This method is functional but can be verbose when constraints are identical. ```csharp [If(nameof(Exterior, "white", "isWhite"))] [If(nameof(Exterior, "black", "isBlack"))] class CarColors { [Const("gray", ConditionGroup = "isWhite")] [Const("gray", ConditionGroup = "isBlack")] public string Interior { get; set; } public string Exterior { get; set; } } ``` -------------------------------- ### GetDividend (ModRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the dividend for a ModRule. ```APIDOC ## GetDividend(this ModRule rule) ### Description Gets the rule that returns the dividend. ### Method `public static Rule GetDividend(this ModRule rule)` ### Parameters #### Path Parameters - **rule** (ModRule) - Required - The rule. ``` -------------------------------- ### Build Method Source: https://docs.json-everything.net/api/JsonSchema.Net/JsonSchemaBuilder Builds a JSON schema from the configured keywords. ```APIDOC ## Methods ### Build(BuildOptions options, Uri baseUri) Builds a JSON schema from the configured keywords and returns a corresponding Json.Schema.JsonSchema instance. #### Declaration ```csharp public JsonSchema Build(BuildOptions options, Uri baseUri) ``` #### Parameters - **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 URIs. #### Returns A Json.Schema.JsonSchema instance representing the constructed schema based on the provided options and base URI. ``` -------------------------------- ### GetDividend (DivideRule) Source: https://docs.json-everything.net/api/JsonLogic/RuleExtensions Gets the rule that returns the dividend for a DivideRule. ```APIDOC ## GetDividend(this DivideRule rule) ### Description Gets the rule that returns the dividend. ### Method `public static Rule GetDividend(this DivideRule rule)` ### Parameters #### Path Parameters - **rule** (DivideRule) - Required - The rule. ```