vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Check the specification field that indicates the required fields is valid.
   *
   * @param env validation environment to use.
   *
   * @throws ValidationErrorException if it is not an instance of.
   */
Check the specification field that indicates the required fields is valid.
@param env validation environment to use.

@throws ValidationErrorException if it is not an instance of.
Check the specification field that indicates the required fields is valid . @param env validation environment to use . @throws ValidationErrorException if it is not an instance of .
private static void checkRequired(@NotNull final SpecificationEnvironment env) throws ValidationErrorException {
    final var value = env.specification.getValue("required");
    if (value instanceof JsonArray) {
      checkIfTypeIs("required", env, "object");
      final var array = (JsonArray) value;
      final var max = array.size();
      if (max == 0) {
        throw env.notValid("required", "You must define at least one required field.");
      } else {
        for (var i = 0; i < max; i++) {
          final var element = array.getValue(i);
          if (!(element instanceof String)) {
            throw env.notValid("required[" + i + "]", "Expecting a 'string' value.");
          }
        }
      }
    } else {
      throw env.notValid("required", "Expecting a 'JsonArray' value.");
    }
  }
private static void checkRequired ( @ NotNull final SpecificationEnvironment env ) throws ValidationErrorException { final var value = env . specification . getValue ( "required" ) ; if ( value instanceof JsonArray ) { checkIfTypeIs ( "required" , env , "object" ) ; final var array = ( JsonArray ) value ; final var max = array . size ( ) ; if ( max == 0 ) { throw env . notValid ( "required" , "You must define at least one required field." ) ; } else { for ( var i = 0 ; i < max ; i ++ ) { final var element = array . getValue ( i ) ; if ( ! ( element instanceof String ) ) { throw env . notValid ( "required[" + i + "]" , "Expecting a 'string' value." ) ; } } } } else { throw env . notValid ( "required" , "Expecting a 'JsonArray' value." ) ; } }
Check the specification field that indicates the required fields is valid.
Check the specification field that indicates the required fields is valid .