vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Check that the addition properties field is right.
   *
   * @param futureToCompose future to compose.
   * @param env             validation environment to use.
   *
   * @throws ValidationErrorException if it is not an instance of.
   *
   * @return the future to check the additional properties.
   */
Check that the addition properties field is right.
@param futureToCompose future to compose.
@param env             validation environment to use.

@throws ValidationErrorException if it is not an instance of.

@return the future to check the additional properties.
Check that the addition properties field is right . @param futureToCompose future to compose . @param env validation environment to use . @throws ValidationErrorException if it is not an instance of . @return the future to check the additional properties .
private static Future<SpecificationEnvironment> checkAdditionalProperties(
      @NotNull final Future<SpecificationEnvironment> futureToCompose, @NotNull final SpecificationEnvironment env)
      throws ValidationErrorException {
    var future = futureToCompose;
    if (env.specification.containsKey("properties")) {
      throw env.notValid("additionalProperties", "You cannot mix 'additionalProperties' with some  'properties'.");
    }
    final var value = env.specification.getValue("additionalProperties");
    if (value instanceof Boolean) {
      if (((Boolean) value).booleanValue()) {
        checkIfTypeIs("additionalProperties", env, "object");
      }
    } else if (value instanceof JsonObject) {
      final var additionalProperties = (JsonObject) value;
      future = future.compose(
          chain -> validateSpecification(chain.prefixFor("additionalProperties"), chain.vertx, additionalProperties)
              .map(any -> chain));
    } else {
      throw env.notValid("additionalProperties", "Expecting a 'JsonObject' or 'boolean' value.");
    }
    return future;
  }
private static Future < SpecificationEnvironment > checkAdditionalProperties ( @ NotNull final Future < SpecificationEnvironment > futureToCompose , @ NotNull final SpecificationEnvironment env ) throws ValidationErrorException { var future = futureToCompose ; if ( env . specification . containsKey ( "properties" ) ) { throw env . notValid ( "additionalProperties" , "You cannot mix 'additionalProperties' with some  'properties'." ) ; } final var value = env . specification . getValue ( "additionalProperties" ) ; if ( value instanceof Boolean ) { if ( ( ( Boolean ) value ) . booleanValue ( ) ) { checkIfTypeIs ( "additionalProperties" , env , "object" ) ; } } else if ( value instanceof JsonObject ) { final var additionalProperties = ( JsonObject ) value ; future = future . compose ( chain -> validateSpecification ( chain . prefixFor ( "additionalProperties" ) , chain . vertx , additionalProperties ) . map ( any -> chain ) ) ; } else { throw env . notValid ( "additionalProperties" , "Expecting a 'JsonObject' or 'boolean' value." ) ; } return future ; }
Check that the addition properties field is right.
Check that the addition properties field is right .