vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Validate that the values or an array are unique.
   *
   * @param promise     to inform of the validation.
   * @param environment to use for the validation.
   *
   * @return the future that says if the array values are uniques or not.
   */
Validate that the values or an array are unique.
@param promise     to inform of the validation.
@param environment to use for the validation.

@return the future that says if the array values are uniques or not.
Validate that the values or an array are unique . @param promise to inform of the validation . @param environment to use for the validation . @return the future that says if the array values are uniques or not .
static Future<ValueEnvironment> validateArrayUniqueItemsValue(@NotNull final Promise<ValueEnvironment> promise,
      @NotNull final ValueEnvironment environment) {
    final var value = (JsonArray) environment.value;
    final var max = value.size();
    I: for (var i = 0; i < max; i++) {
      for (var j = i + 1; j < max; j++) {
        final var a = value.getValue(i);
        final var b = value.getValue(j);
        if (a == null && b == null || a != null && a.equals(b)) {
          promise.fail(environment.notValid(j, "Duplicated value"));
          break I;
        }
      }
    }
    return promise.future();
  }
static Future < ValueEnvironment > validateArrayUniqueItemsValue ( @ NotNull final Promise < ValueEnvironment > promise , @ NotNull final ValueEnvironment environment ) { final var value = ( JsonArray ) environment . value ; final var max = value . size ( ) ; I : for ( var i = 0 ; i < max ; i ++ ) { for ( var j = i + 1 ; j < max ; j ++ ) { final var a = value . getValue ( i ) ; final var b = value . getValue ( j ) ; if ( a == null && b == null || a != null && a . equals ( b ) ) { promise . fail ( environment . notValid ( j , "Duplicated value" ) ) ; break I ; } } } return promise . future ( ) ; }
Validate that the values or an array are unique.
Validate that the values or an array are unique .