vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Check that a composed specification is right. A composed specification is an
   * object where each field is a specification.
   *
   * @param promise that manage the future.
   * @param env     environment with the data to validate.
   *
   * @return the future that inform if the specification is right or not.
   */
Check that a composed specification is right. A composed specification is an
object where each field is a specification.

@param promise that manage the future.
@param env     environment with the data to validate.

@return the future that inform if the specification is right or not.
Check that a composed specification is right . A composed specification is an object where each field is a specification . @param promise that manage the future . @param env environment with the data to validate . @return the future that inform if the specification is right or not .
static private Future<SpecificationEnvironment> validateComposedSpecification(
      @NotNull final Promise<SpecificationEnvironment> promise, @NotNull final SpecificationEnvironment env) {
    var future = promise.future();
    if (env.specification == null) {
      promise.fail(env.notValid("The OpenAPI specification can not be null."));
    } else {
      for (final var propertyName : env.specification.fieldNames()) {
        final var value = env.specification.getValue(propertyName);
        if (value instanceof JsonObject) {
          final var propertySpecification = (JsonObject) value;
          future = future
              .compose(chain -> validateSpecification(env.prefixFor(propertyName), env.vertx, propertySpecification)
                  .map(empty -> chain));
        } else {
          promise.fail(env.notValid(propertyName, "Expecting a JSON object."));
          break;
        }
      }
    }
    return future;
  }
static private Future < SpecificationEnvironment > validateComposedSpecification ( @ NotNull final Promise < SpecificationEnvironment > promise , @ NotNull final SpecificationEnvironment env ) { var future = promise . future ( ) ; if ( env . specification == null ) { promise . fail ( env . notValid ( "The OpenAPI specification can not be null." ) ) ; } else { for ( final var propertyName : env . specification . fieldNames ( ) ) { final var value = env . specification . getValue ( propertyName ) ; if ( value instanceof JsonObject ) { final var propertySpecification = ( JsonObject ) value ; future = future . compose ( chain -> validateSpecification ( env . prefixFor ( propertyName ) , env . vertx , propertySpecification ) . map ( empty -> chain ) ) ; } else { promise . fail ( env . notValid ( propertyName , "Expecting a JSON object." ) ) ; break ; } } } return future ; }
Check that a composed specification is right.
Check that a composed specification is right .