prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bug: OpenAPI schema generation fails due to same operation IDs
  ### Description
  
  If two routes with the same path, but different methods are defined then the OpenAPI generation fails due to both of them having the same value for operation ID. After running `git bisect`, #2805 seems to have introduced this.
  
  ### URL to code causing the issue
  
  _No response_
  
  ### MCVE
  
  ```python
  from litestar import get, post
  from litestar.app import Litestar
  from litestar.testing import create_test_client
  
  
  @post("/")
  async def post_handler() -> None:
      ...
  
  
  @get("/")
  async def get_handler() -> None:
      ...
  
  
  with create_test_client([post_handler, get_handler]) as client:
      response = client.get("/schema/openapi.json")
  
      assert response.status_code == 200
  ```
  
  
  ### Steps to reproduce
  
  _No response_
  
  ### Screenshots
  
  _No response_
  
  ### Logs
  
  _No response_
  
  ### Litestar Version
  
  HEAD
  
  ### Platform
  
  - [ ] Linux
  - [ ] 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 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/2863">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/litestar-org/litestar/issues/2863/pledge.svg?darkmode=1">
    <img alt="Fund with Polar" src="https://polar.sh/api/github/litestar-org/litestar/issues/2863/pledge.svg">
  </picture>
  </a>
  <!-- POLAR PLEDGE BADGE END -->
  
  
  </issue>
  <code>
  [start of litestar/_openapi/plugin.py]
  1 from __future__ import annotations
  2 
  3 from typing import TYPE_CHECKING
  4 
  5 from litestar._openapi.datastructures import OpenAPIContext
  6 from litestar._openapi.path_item import create_path_item_for_route
  7 from litestar.exceptions import ImproperlyConfiguredException
  8 from litestar.plugins import InitPluginProtocol
  9 from litestar.plugins.base import ReceiveRoutePlugin
  10 from litestar.routes import HTTPRoute
  11 
  12 if TYPE_CHECKING:
  13     from litestar.app import Litestar
  14     from litestar.config.app import AppConfig
  15     from litestar.openapi.config import OpenAPIConfig
  16     from litestar.openapi.spec import OpenAPI
  17     from litestar.routes import BaseRoute
  18 
  19 
  20 class OpenAPIPlugin(InitPluginProtocol, ReceiveRoutePlugin):
  21     __slots__ = (
  22         "app",
  23         "included_routes",
  24         "_openapi_config",
  25         "_openapi_schema",
  26     )
  27 
  28     def __init__(self, app: Litestar) -> None:
  29         self.app = app
  30         self.included_routes: list[HTTPRoute] = []
  31         self._openapi_config: OpenAPIConfig | None = None
  32         self._openapi_schema: OpenAPI | None = None
  33 
  34     def _build_openapi_schema(self) -> OpenAPI:
  35         openapi = self.openapi_config.to_openapi_schema()
  36         context = OpenAPIContext(openapi_config=self.openapi_config, plugins=self.app.plugins.openapi)
  37         openapi.paths = {
  38             route.path_format or "/": create_path_item_for_route(context, route) for route in self.included_routes
  39         }
  40         openapi.components.schemas = context.schema_registry.generate_components_schemas()
  41         return openapi
  42 
  43     def provide_openapi(self) -> OpenAPI:
  44         if not self._openapi_schema:
  45             self._openapi_schema = self._build_openapi_schema()
  46         return self._openapi_schema
  47 
  48     def on_app_init(self, app_config: AppConfig) -> AppConfig:
  49         if app_config.openapi_config:
  50             self._openapi_config = app_config.openapi_config
  51             app_config.route_handlers.append(self.openapi_config.openapi_controller)
  52         return app_config
  53 
  54     @property
  55     def openapi_config(self) -> OpenAPIConfig:
  56         if not self._openapi_config:
  57             raise ImproperlyConfiguredException("OpenAPIConfig not initialized")
  58         return self._openapi_config
  59 
  60     def receive_route(self, route: BaseRoute) -> None:
  61         if not isinstance(route, HTTPRoute):
  62             return
  63 
  64         if any(route_handler.resolve_include_in_schema() for route_handler, _ in route.route_handler_map.values()):
  65             # Force recompute the schema if a new route is added
  66             self._openapi_schema = None
  67             self.included_routes.append(route)
  68
  [end of litestar/_openapi/plugin.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/litestar/_openapi/plugin.py b/litestar/_openapi/plugin.py
  --- a/litestar/_openapi/plugin.py
  +++ b/litestar/_openapi/plugin.py
  @@ -27,7 +27,7 @@
   
       def __init__(self, app: Litestar) -> None:
           self.app = app
  -        self.included_routes: list[HTTPRoute] = []
  +        self.included_routes: dict[str, HTTPRoute] = {}
           self._openapi_config: OpenAPIConfig | None = None
           self._openapi_schema: OpenAPI | None = None
   
  @@ -35,7 +35,8 @@
           openapi = self.openapi_config.to_openapi_schema()
           context = OpenAPIContext(openapi_config=self.openapi_config, plugins=self.app.plugins.openapi)
           openapi.paths = {
  -            route.path_format or "/": create_path_item_for_route(context, route) for route in self.included_routes
  +            route.path_format or "/": create_path_item_for_route(context, route)
  +            for route in self.included_routes.values()
           }
           openapi.components.schemas = context.schema_registry.generate_components_schemas()
           return openapi
  @@ -64,4 +65,4 @@
           if any(route_handler.resolve_include_in_schema() for route_handler, _ in route.route_handler_map.values()):
               # Force recompute the schema if a new route is added
               self._openapi_schema = None
  -            self.included_routes.append(route)
  +            self.included_routes[route.path] = route
  
verification_info: {"golden_diff": "diff --git a/litestar/_openapi/plugin.py b/litestar/_openapi/plugin.py\n--- a/litestar/_openapi/plugin.py\n+++ b/litestar/_openapi/plugin.py\n@@ -27,7 +27,7 @@\n \n     def __init__(self, app: Litestar) -> None:\n         self.app = app\n-        self.included_routes: list[HTTPRoute] = []\n+        self.included_routes: dict[str, HTTPRoute] = {}\n         self._openapi_config: OpenAPIConfig | None = None\n         self._openapi_schema: OpenAPI | None = None\n \n@@ -35,7 +35,8 @@\n         openapi = self.openapi_config.to_openapi_schema()\n         context = OpenAPIContext(openapi_config=self.openapi_config, plugins=self.app.plugins.openapi)\n         openapi.paths = {\n-            route.path_format or \"/\": create_path_item_for_route(context, route) for route in self.included_routes\n+            route.path_format or \"/\": create_path_item_for_route(context, route)\n+            for route in self.included_routes.values()\n         }\n         openapi.components.schemas = context.schema_registry.generate_components_schemas()\n         return openapi\n@@ -64,4 +65,4 @@\n         if any(route_handler.resolve_include_in_schema() for route_handler, _ in route.route_handler_map.values()):\n             # Force recompute the schema if a new route is added\n             self._openapi_schema = None\n-            self.included_routes.append(route)\n+            self.included_routes[route.path] = route\n", "issue": "Bug: OpenAPI schema generation fails due to same operation IDs\n### Description\n\nIf two routes with the same path, but different methods are defined then the OpenAPI generation fails due to both of them having the same value for operation ID. After running `git bisect`, #2805 seems to have introduced this.\n\n### URL to code causing the issue\n\n_No response_\n\n### MCVE\n\n```python\nfrom litestar import get, post\r\nfrom litestar.app import Litestar\r\nfrom litestar.testing import create_test_client\r\n\r\n\r\n@post(\"/\")\r\nasync def post_handler() -> None:\r\n    ...\r\n\r\n\r\n@get(\"/\")\r\nasync def get_handler() -> None:\r\n    ...\r\n\r\n\r\nwith create_test_client([post_handler, get_handler]) as client:\r\n    response = client.get(\"/schema/openapi.json\")\r\n\r\n    assert response.status_code == 200\n```\n\n\n### Steps to reproduce\n\n_No response_\n\n### Screenshots\n\n_No response_\n\n### Logs\n\n_No response_\n\n### Litestar Version\n\nHEAD\n\n### Platform\n\n- [ ] Linux\n- [ ] Mac\n- [ ] Windows\n- [ ] Other (Please specify in the description above)\n\n<!-- POLAR PLEDGE BADGE START -->\n---\n> [!NOTE]  \n> While we are open for sponsoring on [GitHub Sponsors](https://github.com/sponsors/litestar-org/) and \n> [OpenCollective](https://opencollective.com/litestar), we also utilize [Polar.sh](https://polar.sh/) to engage in pledge-based sponsorship.\n>\n> Check out all issues funded or available for funding [on our Polar.sh dashboard](https://polar.sh/litestar-org)\n> * If you would like to see an issue prioritized, make a pledge towards it!\n> * We receive the pledge once the issue is completed & verified\n> * This, along with engagement in the community, helps us know which features are a priority to our users.\n\n<a href=\"https://polar.sh/litestar-org/litestar/issues/2863\">\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://polar.sh/api/github/litestar-org/litestar/issues/2863/pledge.svg?darkmode=1\">\n  <img alt=\"Fund with Polar\" src=\"https://polar.sh/api/github/litestar-org/litestar/issues/2863/pledge.svg\">\n</picture>\n</a>\n<!-- POLAR PLEDGE BADGE END -->\n\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom litestar._openapi.datastructures import OpenAPIContext\nfrom litestar._openapi.path_item import create_path_item_for_route\nfrom litestar.exceptions import ImproperlyConfiguredException\nfrom litestar.plugins import InitPluginProtocol\nfrom litestar.plugins.base import ReceiveRoutePlugin\nfrom litestar.routes import HTTPRoute\n\nif TYPE_CHECKING:\n    from litestar.app import Litestar\n    from litestar.config.app import AppConfig\n    from litestar.openapi.config import OpenAPIConfig\n    from litestar.openapi.spec import OpenAPI\n    from litestar.routes import BaseRoute\n\n\nclass OpenAPIPlugin(InitPluginProtocol, ReceiveRoutePlugin):\n    __slots__ = (\n        \"app\",\n        \"included_routes\",\n        \"_openapi_config\",\n        \"_openapi_schema\",\n    )\n\n    def __init__(self, app: Litestar) -> None:\n        self.app = app\n        self.included_routes: list[HTTPRoute] = []\n        self._openapi_config: OpenAPIConfig | None = None\n        self._openapi_schema: OpenAPI | None = None\n\n    def _build_openapi_schema(self) -> OpenAPI:\n        openapi = self.openapi_config.to_openapi_schema()\n        context = OpenAPIContext(openapi_config=self.openapi_config, plugins=self.app.plugins.openapi)\n        openapi.paths = {\n            route.path_format or \"/\": create_path_item_for_route(context, route) for route in self.included_routes\n        }\n        openapi.components.schemas = context.schema_registry.generate_components_schemas()\n        return openapi\n\n    def provide_openapi(self) -> OpenAPI:\n        if not self._openapi_schema:\n            self._openapi_schema = self._build_openapi_schema()\n        return self._openapi_schema\n\n    def on_app_init(self, app_config: AppConfig) -> AppConfig:\n        if app_config.openapi_config:\n            self._openapi_config = app_config.openapi_config\n            app_config.route_handlers.append(self.openapi_config.openapi_controller)\n        return app_config\n\n    @property\n    def openapi_config(self) -> OpenAPIConfig:\n        if not self._openapi_config:\n            raise ImproperlyConfiguredException(\"OpenAPIConfig not initialized\")\n        return self._openapi_config\n\n    def receive_route(self, route: BaseRoute) -> None:\n        if not isinstance(route, HTTPRoute):\n            return\n\n        if any(route_handler.resolve_include_in_schema() for route_handler, _ in route.route_handler_map.values()):\n            # Force recompute the schema if a new route is added\n            self._openapi_schema = None\n            self.included_routes.append(route)\n", "path": "litestar/_openapi/plugin.py"}]}