vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Validate that the value does not contains any unexpected field.
   *
   * @param promise     to inform of the validation.
   * @param environment to use for the validation.
   *
   * @return the future that says if the value has all the expected fields or not.
   */
Validate that the value does not contains any unexpected field.
@param promise     to inform of the validation.
@param environment to use for the validation.

@return the future that says if the value has all the expected fields or not.
Validate that the value does not contains any unexpected field . @param promise to inform of the validation . @param environment to use for the validation . @return the future that says if the value has all the expected fields or not .
static Future<ValueEnvironment> validateUndefinedFieldsInValue(@NotNull final Promise<ValueEnvironment> promise,
      @NotNull final ValueEnvironment environment) {
    if (environment.value instanceof JsonObject && environment.fieldNames != null) {
      final var value = (JsonObject) environment.value;
      for (final var field : value.fieldNames()) {
        if (!environment.fieldNames.contains(field)) {
          promise.fail(environment.notValid(field, "The field is not defined on the specification."));
          break;
        }
      }
    }
    return promise.future();
  }
static Future < ValueEnvironment > validateUndefinedFieldsInValue ( @ NotNull final Promise < ValueEnvironment > promise , @ NotNull final ValueEnvironment environment ) { if ( environment . value instanceof JsonObject && environment . fieldNames != null ) { final var value = ( JsonObject ) environment . value ; for ( final var field : value . fieldNames ( ) ) { if ( ! environment . fieldNames . contains ( field ) ) { promise . fail ( environment . notValid ( field , "The field is not defined on the specification." ) ) ; break ; } } } return promise . future ( ) ; }
Validate that the value does not contains any unexpected field.
Validate that the value does not contains any unexpected field .