async updateSpecifications(request) {
    const { index, collection } = request.getIndexAndCollection();
    const specifications = request.getBody();

    const { isValid, errors } = await global.kuzzle.validation.validateFormat(
      index,
      collection,
      specifications,
      true,
    );

    if (!isValid) {
      throw kerror.get(
        "validation",
        "assert",
        "invalid_specifications",
        errors.join("\n\t- "),
      );
    }

    await global.kuzzle.internalIndex.createOrReplace(
      "validations",
      `${index}#${collection}`,
      {
        collection,
        index,
        validation: specifications,
      },
    );

    await global.kuzzle.internalIndex.refreshCollection("validations");
    await global.kuzzle.validation.curateSpecification();

    return specifications;
  }
Replace the specifications of a collection

@param {Request} request
@returns {Promise.<Object>}