SDK
SDK Dart Null Safety v3.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.


Copied to clipboard!
Future<bool> validateSpecifications(
    String index,
    String collection,
    bool strict,
    Map<String, dynamic> fields,
  )

Arguments Type Description
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 #

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