JsonExtensions.IsValid Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Validates the properties of the given JSON object, enforcing the presence of required properties and ignoring the order of properties.
public static bool IsValid (this Newtonsoft.Json.Linq.JObject obj, System.Collections.Generic.IEnumerable<string> requiredProperties, Func<Newtonsoft.Json.Linq.JProperty,bool> isPropertyValid);
static member IsValid : Newtonsoft.Json.Linq.JObject * seq<string> * Func<Newtonsoft.Json.Linq.JProperty, bool> -> bool
<Extension()>
Public Function IsValid (obj As JObject, requiredProperties As IEnumerable(Of String), isPropertyValid As Func(Of JProperty, Boolean)) As Boolean
Parameters
- obj
- Newtonsoft.Json.Linq.JObject
The JSON object to validate.
- requiredProperties
- IEnumerable<String>
The names of all JSON properties that are expected to be present in the given object.
A predicate that determines whether the name and value of given JProperty
are valid.
Returns
true
if all properties of the given JSON object pass the given validation function and all required properties exist,
false
otherwise.
Applies to
Azure SDK for .NET