vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Validate that the value is type of the specified values.
   *
   * @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 is type of the specified values.
@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 is type of the specified values . @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 private Future<ValueEnvironment> validateTypeValue(@NotNull final Promise<ValueEnvironment> promise,
      @NotNull final ValueEnvironment environment) {
    var future = promise.future();
    final var type = environment.specification.getString("type");
    switch (type) {
    case "boolean":
      future = composeValidation(future, OpenAPIValidator::validateBooleanValue);
      break;
    case "string":
      future = composeValidation(future, OpenAPIValidator::validateStringValue);
      break;
    case "integer":
      future = composeValidation(future, OpenAPIValidator::validateIntegerValue);
      break;
    case "number":
      future = composeValidation(future, OpenAPIValidator::validateNumberValue);
      break;
    case "object":
      future = composeValidation(future, OpenAPIValidator::validateObjectValue);
      break;
    case "array":
      future = composeValidation(future, OpenAPIValidator::validateArrayValue);
      break;
    default:
      promise.fail(environment.notValid("Bad OpenAPI definition with an unexpected 'type' for the value."));
    }
    return future;
  }
static private Future < ValueEnvironment > validateTypeValue ( @ NotNull final Promise < ValueEnvironment > promise , @ NotNull final ValueEnvironment environment ) { var future = promise . future ( ) ; final var type = environment . specification . getString ( "type" ) ; switch ( type ) { case "boolean" : future = composeValidation ( future , OpenAPIValidator :: validateBooleanValue ) ; break ; case "string" : future = composeValidation ( future , OpenAPIValidator :: validateStringValue ) ; break ; case "integer" : future = composeValidation ( future , OpenAPIValidator :: validateIntegerValue ) ; break ; case "number" : future = composeValidation ( future , OpenAPIValidator :: validateNumberValue ) ; break ; case "object" : future = composeValidation ( future , OpenAPIValidator :: validateObjectValue ) ; break ; case "array" : future = composeValidation ( future , OpenAPIValidator :: validateArrayValue ) ; break ; default : promise . fail ( environment . notValid ( "Bad OpenAPI definition with an unexpected 'type' for the value." ) ) ; } return future ; }
Validate that the value is type of the specified values.
Validate that the value is type of the specified values .