vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Check that the properties value is right.
   *
   * @param future to compose.
   * @param env    validation environment to use.
   *
   * @throws ValidationErrorException if it is not an instance of.
   *
   * @return the future that say if the properties value is valid or not.
   */
Check that the properties value is right.
@param future to compose.
@param env    validation environment to use.

@throws ValidationErrorException if it is not an instance of.

@return the future that say if the properties value is valid or not.
Check that the properties value is right . @param future to compose . @param env validation environment to use . @throws ValidationErrorException if it is not an instance of . @return the future that say if the properties value is valid or not .
private static Future<SpecificationEnvironment> checkProperties(
      @NotNull final Future<SpecificationEnvironment> future, @NotNull final SpecificationEnvironment env)
      throws ValidationErrorException {
    final var value = env.specification.getValue("properties");
    if (value instanceof JsonObject) {
      checkIfTypeIs("properties", env, "object");
      var propertiesFuture = future;
      final var properties = (JsonObject) value;
      for (final var propertyName : properties.fieldNames()) {
        final var propertyValue = properties.getValue(propertyName);
        final var propertyPrefix = "properties." + propertyName;
        if (propertyValue instanceof JsonObject) {
          final var propertySpecification = (JsonObject) propertyValue;
          propertiesFuture = propertiesFuture.compose(
              chain -> validateSpecification(chain.prefixFor(propertyPrefix), chain.vertx, propertySpecification)
                  .map(empty -> chain));
        } else {
          throw env.notValid(propertyPrefix, "Expecting a 'JsonObject' value.");
        }
      }
      return propertiesFuture;
    } else {
      throw env.notValid("properties", "Expecting a 'JsonObject' value.");
    }
  }
private static Future < SpecificationEnvironment > checkProperties ( @ NotNull final Future < SpecificationEnvironment > future , @ NotNull final SpecificationEnvironment env ) throws ValidationErrorException { final var value = env . specification . getValue ( "properties" ) ; if ( value instanceof JsonObject ) { checkIfTypeIs ( "properties" , env , "object" ) ; var propertiesFuture = future ; final var properties = ( JsonObject ) value ; for ( final var propertyName : properties . fieldNames ( ) ) { final var propertyValue = properties . getValue ( propertyName ) ; final var propertyPrefix = "properties." + propertyName ; if ( propertyValue instanceof JsonObject ) { final var propertySpecification = ( JsonObject ) propertyValue ; propertiesFuture = propertiesFuture . compose ( chain -> validateSpecification ( chain . prefixFor ( propertyPrefix ) , chain . vertx , propertySpecification ) . map ( empty -> chain ) ) ; } else { throw env . notValid ( propertyPrefix , "Expecting a 'JsonObject' value." ) ; } } return propertiesFuture ; } else { throw env . notValid ( "properties" , "Expecting a 'JsonObject' value." ) ; } }
Check that the properties value is right.
Check that the properties value is right .