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,
)
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 #
final result = await kuzzle
.collection
.validateSpecifications('nyc-open-data', 'yellow-taxi', {
'fields': {
'license': {
'type': 'string',
'mandatory': true,
},
},
'strict': false,
});
Edit this page on Github(opens new window)