vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Validate that the value has the required properties.
   *
   * @param promise     to inform of the validation.
   * @param environment to use for the validation.
   *
   * @return the future that says if the value is valid or not.
   */
Validate that the value has the required properties.
@param promise     to inform of the validation.
@param environment to use for the validation.

@return the future that says if the value is valid or not.
Validate that the value has the required properties . @param promise to inform of the validation . @param environment to use for the validation . @return the future that says if the value is valid or not .
static Future<ValueEnvironment> validateRequiredValue(@NotNull final Promise<ValueEnvironment> promise,
      @NotNull final ValueEnvironment environment) {
    final var object = (JsonObject) environment.value;
    final var required = environment.specification.getJsonArray("required");
    final var max = required.size();
    for (var i = 0; i < max; i++) {
      final var key = required.getString(i);
      if (!object.containsKey(key)) {
        promise.fail(environment.notValid(key, "The field '" + key + "' is required."));
        break;
      }
    }
    return promise.future();
  }
static Future < ValueEnvironment > validateRequiredValue ( @ NotNull final Promise < ValueEnvironment > promise , @ NotNull final ValueEnvironment environment ) { final var object = ( JsonObject ) environment . value ; final var required = environment . specification . getJsonArray ( "required" ) ; final var max = required . size ( ) ; for ( var i = 0 ; i < max ; i ++ ) { final var key = required . getString ( i ) ; if ( ! object . containsKey ( key ) ) { promise . fail ( environment . notValid ( key , "The field '" + key + "' is required." ) ) ; break ; } } return promise . future ( ) ; }
Validate that the value has the required properties.
Validate that the value has the required properties .