Adds the subrouter paths and component schemas to main router's openapi specs. @param subrouter_openapi: OpenAPI the OpenAPI object of the current subrouter
(self, subrouter_openapi: "OpenAPI")
| 376 | existing[name] = schema |
| 377 | |
| 378 | def add_subrouter_paths(self, subrouter_openapi: "OpenAPI"): |
| 379 | """ |
| 380 | Adds the subrouter paths and component schemas to main router's openapi specs. |
| 381 | |
| 382 | @param subrouter_openapi: OpenAPI the OpenAPI object of the current subrouter |
| 383 | """ |
| 384 | |
| 385 | if self.openapi_file_override: |
| 386 | return |
| 387 | |
| 388 | for path, path_obj in subrouter_openapi.openapi_spec["paths"].items(): |
| 389 | self.openapi_spec["paths"][path] = path_obj |
| 390 | |
| 391 | subrouter_schemas = subrouter_openapi.openapi_spec.get("components", {}).get("schemas", {}) |
| 392 | if subrouter_schemas: |
| 393 | self._merge_component_schemas(subrouter_schemas) |
| 394 | |
| 395 | def get_path_obj( |
| 396 | self, |
no test coverage detected