Repository: litestar-org/litestar

Issue:
Bug: Dependency function passes `...` when both `default` and `skip_validation` are specified
```python
@get("/")
def hello_world(a: int = Dependency(default=1, skip_validation=True)) -> dict[str, Any]:
    """Route Handler that outputs hello world."""
    print(f"{a = }, {type(a) = }")  # a = Ellipsis, type(a) = <class 'ellipsis'>
    return {"hello": "world"}
```
default value injected into handler function is  `Ellipsis`, should be `1`.


Discussion:

Resolving patch:
diff --git a/starlite/signature.py b/starlite/signature.py
--- a/starlite/signature.py
+++ b/starlite/signature.py
@@ -348,8 +348,10 @@ def create_signature_model(self) -> Type[SignatureModel]:
                 self.collect_dependency_names(parameter)
                 self.set_field_default(parameter)
                 if self.should_skip_parameter_validation(parameter):
-                    # pydantic has issues with none-pydantic classes that receive generics
-                    self.field_definitions[parameter.name] = (Any, ...)
+                    if is_dependency_field(parameter.default):
+                        self.field_definitions[parameter.name] = (Any, parameter.default.default)
+                    else:
+                        self.field_definitions[parameter.name] = (Any, ...)
                     continue
                 if ModelFactory.is_constrained_field(parameter.default):
                     self.field_definitions[parameter.name] = (parameter.default, ...)
diff --git a/starlite/utils/dependency.py b/starlite/utils/dependency.py
--- a/starlite/utils/dependency.py
+++ b/starlite/utils/dependency.py
@@ -1,11 +1,14 @@
-from typing import Any
+from typing import TYPE_CHECKING, Any
 
 from pydantic.fields import FieldInfo
 
 from starlite.constants import EXTRA_KEY_IS_DEPENDENCY, EXTRA_KEY_SKIP_VALIDATION
 
+if TYPE_CHECKING:
+    from typing_extensions import TypeGuard
 
-def is_dependency_field(val: Any) -> bool:
+
+def is_dependency_field(val: Any) -> "TypeGuard[FieldInfo]":
     """Determine if a value is a `FieldInfo` instance created via the
     `Dependency()` function.
 
@@ -29,4 +32,4 @@ def should_skip_dependency_validation(val: Any) -> bool:
         `True` if `val` is `FieldInfo` created by [`Dependency()`][starlite.params.Dependency] function and
         `skip_validation=True` is set.
     """
-    return is_dependency_field(val) and val.extra.get(EXTRA_KEY_SKIP_VALIDATION)
+    return is_dependency_field(val) and bool(val.extra.get(EXTRA_KEY_SKIP_VALIDATION))


Test patch:
diff --git a/tests/test_dependency.py b/tests/test_dependency.py
--- a/tests/test_dependency.py
+++ b/tests/test_dependency.py
@@ -94,3 +94,14 @@ def skipped(value: int = Dependency(skip_validation=True)) -> Dict[str, int]:
         skipped_resp = client.get("/skipped")
         assert skipped_resp.status_code == HTTP_200_OK
         assert skipped_resp.json() == {"value": "str"}
+
+
+def test_dependency_skip_validation_with_default_value() -> None:
+    @get("/skipped")
+    def skipped(value: int = Dependency(default=1, skip_validation=True)) -> Dict[str, int]:
+        return {"value": value}
+
+    with create_test_client(route_handlers=[skipped]) as client:
+        skipped_resp = client.get("/skipped")
+        assert skipped_resp.status_code == HTTP_200_OK
+        assert skipped_resp.json() == {"value": 1}