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

@return the future that says if the value is valid with the reference type or
not.
Validate that the value is valid for a reference type . @param promise to inform of the validation . @param env environment to use for the validation . @return the future that says if the value is valid with the reference type or not .
static private Future<ValueEnvironment> validateRefValue(@NotNull final Promise<ValueEnvironment> promise,
      @NotNull final ValueEnvironment env) {
    final var ref = env.specification.getString("$ref");
    return promise.future().compose(chain -> chain.obtainSchemaFor(ref).transform(get -> {
      final Promise<ValueEnvironment> refPromise = Promise.promise();
      var future = refPromise.future();
      if (get.failed()) {
        refPromise.fail(chain.notValid("Cannot obtain the reference type to check the value.", get.cause()));
      } else {
        refPromise.complete();
        final var type = get.result();
        future = future
            .compose(empty -> validateValue(chain.codePrefix, chain.vertx, type, chain.value).map(validValue -> {
              chain.value = validValue;
              return chain;
            }));
      }
      return future;
    }));
  }
static private Future < ValueEnvironment > validateRefValue ( @ NotNull final Promise < ValueEnvironment > promise , @ NotNull final ValueEnvironment env ) { final var ref = env . specification . getString ( "$ref" ) ; return promise . future ( ) . compose ( chain -> chain . obtainSchemaFor ( ref ) . transform ( get -> { final Promise < ValueEnvironment > refPromise = Promise . promise ( ) ; var future = refPromise . future ( ) ; if ( get . failed ( ) ) { refPromise . fail ( chain . notValid ( "Cannot obtain the reference type to check the value." , get . cause ( ) ) ) ; } else { refPromise . complete ( ) ; final var type = get . result ( ) ; future = future . compose ( empty -> validateValue ( chain . codePrefix , chain . vertx , type , chain . value ) . map ( validValue -> { chain . value = validValue ; return chain ; } ) ) ; } return future ; } ) ) ; }
Validate that the value is valid for a reference type.
Validate that the value is valid for a reference type .