SDK
SDK C# v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

ValidateSpecificationsAsync #

The validateSpecifications method checks if validation specifications are well-formed. It does not store nor modify the existing specifications.

If the validation specifications are not formatted correctly, a detailed error message is returned to help with debugging.

Arguments #

public async Task<bool> ValidateSpecificationsAsync(JObject specifications);
ArgumentTypeDescription
specifications
JObject
JObject representating the specifications to validate

specifications #

A JObject representing the specifications to validate.

The JObject data must follow the Specifications Structure:

{
  "strict": "true",
  "fields": {
    "licence": {
      "mandatory": true,
      "type": "string"
    }
    // ... specification for each field
  }
}

Return #

A boolean telling whether the provided specifications are valid.

Usage #

try {
  JObject specifications = JObject.Parse(@"{
    strict: false,
    fields: {
      license: {
        mandatory: true,
        type: 'string'
      }
    }
  }");
  bool validation_response =
    await kuzzle.Collection.ValidateSpecificationsAsync(
      specifications
    );
  Console.WriteLine("Success");
} catch (Exception e) {
  Console.WriteLine(e);
}