vertx/src/main/java/eu/internetofus/common/vertx/OpenAPIValidator.java
/**
   * Check the type of an specification.
   *
   * @param env validation environment to use.
   *
   * @throws ValidationErrorException if the specification is not valid.
   */
Check the type of an specification.
@param env validation environment to use.

@throws ValidationErrorException if the specification is not valid.
Check the type of an specification . @param env validation environment to use . @throws ValidationErrorException if the specification is not valid .
private static void checkType(@NotNull final SpecificationEnvironment env) throws ValidationErrorException {
    final var type = env.specification.getValue("type");
    if (type instanceof String) {
      final var typeName = (String) type;
      switch (typeName) {
      case "boolean":
      case "number":
      case "integer":
      case "string":
      case "object":
        break;
      case "array":
        if (!env.specification.containsKey("items")) {
          throw env.notValid("type", "You must define the field 'items' when the 'type' = 'array'.");
        }
        break;
      default:
        throw env.notValid("type", "Undefined 'type' value.");
      }
      env.addFoundType(typeName);
    } else {
      throw env.notValid("type", "Expecting a 'string' value.");
    }
  }
private static void checkType ( @ NotNull final SpecificationEnvironment env ) throws ValidationErrorException { final var type = env . specification . getValue ( "type" ) ; if ( type instanceof String ) { final var typeName = ( String ) type ; switch ( typeName ) { case "boolean" : case "number" : case "integer" : case "string" : case "object" : break ; case "array" : if ( ! env . specification . containsKey ( "items" ) ) { throw env . notValid ( "type" , "You must define the field 'items' when the 'type' = 'array'." ) ; } break ; default : throw env . notValid ( "type" , "Undefined 'type' value." ) ; } env . addFoundType ( typeName ) ; } else { throw env . notValid ( "type" , "Expecting a 'string' value." ) ; } }
Check the type of an specification.
Check the type of an specification .
// nothing more to check