vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Check the specification field that indicates that a number has to be as
   * maximum of another value.
   *
   * @param env validation environment to use.
   *
   * @throws ValidationErrorException if it is not an instance of.
   */
Check the specification field that indicates that a number has to be as
maximum of another value.

@param env validation environment to use.

@throws ValidationErrorException if it is not an instance of.
Check the specification field that indicates that a number has to be as maximum of another value . @param env validation environment to use . @throws ValidationErrorException if it is not an instance of .
private static void checkMaximum(@NotNull final SpecificationEnvironment env) throws ValidationErrorException {
    final var value = env.specification.getValue("maximum");
    if (value instanceof Number) {
      final var maximum = (Number) value;
      final var minimum = env.specification.getNumber("minimum", 0.0d);
      final var exclusiveMinimum = env.specification.getBoolean("exclusiveMinimum", false);
      final var compare = Double.compare(minimum.doubleValue(), maximum.doubleValue());
      if (exclusiveMinimum) {
        if (compare >= 0) {
          throw env.notValid("maximum", "The value must be greater than '" + minimum + "'.");
        }
      } else if (compare > 0) {
        throw env.notValid("maximum", "The value must be equal to or greater than '" + minimum + "'.");
      } else {
        checkIfTypeIsOneOf("maximum", env, "integer", "number");
      }
    } else {
      throw env.notValid("maximum", "Expecting a 'number' value.");
    }
  }
private static void checkMaximum ( @ NotNull final SpecificationEnvironment env ) throws ValidationErrorException { final var value = env . specification . getValue ( "maximum" ) ; if ( value instanceof Number ) { final var maximum = ( Number ) value ; final var minimum = env . specification . getNumber ( "minimum" , 0.0d ) ; final var exclusiveMinimum = env . specification . getBoolean ( "exclusiveMinimum" , false ) ; final var compare = Double . compare ( minimum . doubleValue ( ) , maximum . doubleValue ( ) ) ; if ( exclusiveMinimum ) { if ( compare >= 0 ) { throw env . notValid ( "maximum" , "The value must be greater than '" + minimum + "'." ) ; } } else if ( compare > 0 ) { throw env . notValid ( "maximum" , "The value must be equal to or greater than '" + minimum + "'." ) ; } else { checkIfTypeIsOneOf ( "maximum" , env , "integer" , "number" ) ; } } else { throw env . notValid ( "maximum" , "Expecting a 'number' value." ) ; } }
Check the specification field that indicates that a number has to be as
 maximum of another value.
Check the specification field that indicates that a number has to be as maximum of another value .