Repository: litestar-org/litestar

Issue:
Bug: OpenAPI schema generation doesn't support Ellipsis type hint
### Description

if you use an Ellipsis in your type hint, when generating the OpenAPI document the generation of the schema failed with the error

`'<' not supported between instances of 'NoneType' and 'OpenAPIType'`

it would seem that for v2.0.0 on line 219 in `schema_generation/schema.py` it returns an empty `Schema()` object, which has the property `type = None`.   This get passed along to 

`litestar/_openapi/schema_generation/utils.py in sort_schemas_and_references at line 17`

where a `<` comparison is done against a NoneType which fails.

### URL to code causing the issue

_No response_

### MCVE

```python
from __future__ import annotations
from litestar import Litestar, get
from msgspec import Struct

class A(Struct)
  variable_number_of_ints: tuple[int, ...]

@get("/")
async def test() -> A:
    return A()
```


### Steps to reproduce

```bash
1. Run the litestar API
2. Go to http://localhost:8000/schema/swagger
```


### Screenshots

_No response_

### Logs

_No response_

### Litestar Version

2.0.0

### Platform

- [ ] Linux
- [X] Mac
- [ ] Windows
- [ ] Other (Please specify in the description above)

<!-- POLAR PLEDGE BADGE START -->
---
> [!NOTE]  
> While we are open for sponsoring on [GitHub Sponsors](https://github.com/sponsors/litestar-org/) and 
> [OpenCollective](https://opencollective.com/litestar), we also utilize [Polar.sh](https://polar.sh/) to engage in pledge-based sponsorship.
>
> Check out all issues funded or available for funding [on our Polar.sh Litestar dashboard](https://polar.sh/litestar-org)
> * If you would like to see an issue prioritized, make a pledge towards it!
> * We receive the pledge once the issue is completed & verified
> * This, along with engagement in the community, helps us know which features are a priority to our users.

<a href="https://polar.sh/litestar-org/litestar/issues/2460">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/litestar-org/litestar/issues/2460/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/litestar-org/litestar/issues/2460/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->



Discussion:

Resolving patch:
diff --git a/litestar/_openapi/schema_generation/schema.py b/litestar/_openapi/schema_generation/schema.py
--- a/litestar/_openapi/schema_generation/schema.py
+++ b/litestar/_openapi/schema_generation/schema.py
@@ -372,7 +372,9 @@ def for_object_type(self, field_definition: FieldDefinition) -> Schema:
             )
 
         if field_definition.is_non_string_sequence or field_definition.is_non_string_iterable:
-            items = list(map(self.for_field_definition, field_definition.inner_types or ()))
+            # filters out ellipsis from tuple[int, ...] type annotations
+            inner_types = (f for f in field_definition.inner_types if f.annotation is not Ellipsis)
+            items = list(map(self.for_field_definition, inner_types or ()))
             return Schema(
                 type=OpenAPIType.ARRAY,
                 items=Schema(one_of=sort_schemas_and_references(items)) if len(items) > 1 else items[0],


Test patch:
diff --git a/tests/unit/test_openapi/test_schema.py b/tests/unit/test_openapi/test_schema.py
--- a/tests/unit/test_openapi/test_schema.py
+++ b/tests/unit/test_openapi/test_schema.py
@@ -2,7 +2,7 @@
 from dataclasses import dataclass
 from datetime import date
 from enum import Enum, auto
-from typing import TYPE_CHECKING, Any, Dict, Generic, List, Literal, Optional, TypedDict, TypeVar, Union
+from typing import TYPE_CHECKING, Any, Dict, Generic, List, Literal, Optional, Tuple, TypedDict, TypeVar, Union
 
 import annotated_types
 import msgspec
@@ -397,3 +397,10 @@ def test_schema_generation_with_pagination(annotation: Any) -> None:
     assert properties["foo"] == expected_foo_schema
     assert properties["annotated_foo"] == expected_foo_schema
     assert properties["optional_foo"] == expected_optional_foo_schema
+
+
+def test_schema_generation_with_ellipsis() -> None:
+    schema = SchemaCreator().for_field_definition(FieldDefinition.from_annotation(Tuple[int, ...]))
+    assert isinstance(schema, Schema)
+    assert isinstance(schema.items, Schema)
+    assert schema.items.type == OpenAPIType.INTEGER