vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Check that if the type exist is one of the expected ones.
   *
   * @param field         that require a type.
   * @param env           validation environment to use.
   * @param expectedTypes the expected types for the type if it is defined.
   *
   * @throws ValidationErrorException if it is not an instance of.
   */
Check that if the type exist is one of the expected ones.
@param field         that require a type.
@param env           validation environment to use.
@param expectedTypes the expected types for the type if it is defined.

@throws ValidationErrorException if it is not an instance of.
Check that if the type exist is one of the expected ones . @param field that require a type . @param env validation environment to use . @param expectedTypes the expected types for the type if it is defined . @throws ValidationErrorException if it is not an instance of .
private static void checkIfTypeIsOneOf(@NotNull final String field, @NotNull final SpecificationEnvironment env,
      final String... expectedTypes) throws ValidationErrorException {
    final var type = env.specification.getString("type", null);
    if (type != null) {
      for (final var expectedType : expectedTypes) {
        if (type.equals(expectedType)) {
          return;
        }
      }
      throw env.notValid(field,
          "You only can use this feature if 'type' is one of '" + Arrays.toString(expectedTypes) + "'.\"");
    }
  }
private static void checkIfTypeIsOneOf ( @ NotNull final String field , @ NotNull final SpecificationEnvironment env , final String ... expectedTypes ) throws ValidationErrorException { final var type = env . specification . getString ( "type" , null ) ; if ( type != null ) { for ( final var expectedType : expectedTypes ) { if ( type . equals ( expectedType ) ) { return ; } } throw env . notValid ( field , "You only can use this feature if 'type' is one of '" + Arrays . toString ( expectedTypes ) + "'.\"" ) ; } }
Check that if the type exist is one of the expected ones.
Check that if the type exist is one of the expected ones .