public static @Nullable JsonSchemaType getSubtypeOfBoth(@NotNull JsonSchemaType selfType,
                                                          @NotNull JsonSchemaType otherType) {
    if (otherType == JsonSchemaType._any) return selfType;
    if (selfType == JsonSchemaType._any) return otherType;
    return switch (selfType) {
      case _string -> otherType == JsonSchemaType._string || otherType == JsonSchemaType._string_number ? JsonSchemaType._string : null;
      case _number -> {
        if (otherType == JsonSchemaType._integer) yield JsonSchemaType._integer;
        yield otherType == JsonSchemaType._number || otherType == JsonSchemaType._string_number ? JsonSchemaType._number : null;
      }
      case _integer -> otherType == JsonSchemaType._number
                       || otherType == JsonSchemaType._string_number
                       || otherType == JsonSchemaType._integer ? JsonSchemaType._integer : null;
      case _object -> otherType == JsonSchemaType._object ? JsonSchemaType._object : null;
      case _array -> otherType == JsonSchemaType._array ? JsonSchemaType._array : null;
      case _boolean -> otherType == JsonSchemaType._boolean ? JsonSchemaType._boolean : null;
      case _null -> otherType == JsonSchemaType._null ? JsonSchemaType._null : null;
      case _string_number -> otherType == JsonSchemaType._integer
                             || otherType == JsonSchemaType._number
                             || otherType == JsonSchemaType._string
                             || otherType == JsonSchemaType._string_number ? otherType : null;
      default -> otherType;
    };
  }
public static @Nullable JsonSchemaType getSubtypeOfBoth(@NotNull JsonSchemaType selfType,
                                                          @NotNull JsonSchemaType otherType)