SDK
SDK Dart v2.x
2

validateSpecifications #

The validateSpecifications method checks if a validation specification is well formatted. It does not store or modify the existing specification.

When the validation specification is not formatted correctly, a detailed error message is returned to help you fix it.


Future<bool> validateSpecifications(
    String index,
    String collection,
    bool strict,
    Map<String, dynamic> fields,
  )

ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name
specifications
Map<String, dynamic>
Specifications to validate

specifications #

A Map<String, dynamic> representing the specifications.

This object must follow the Specification Structure.

Returns #

Returns a bool which contains information about the specifications validity.

Usage #

final result = await kuzzle
  .collection
  .validateSpecifications('nyc-open-data', 'yellow-taxi', {
    'fields': {
      'license': {
        'type': 'string',
        'mandatory': true,
      },
    },
    'strict': false,
  });