MCPcopy
hub / github.com/sparckles/Robyn / add_subrouter_paths

Method add_subrouter_paths

robyn/openapi.py:378–393  ·  view source on GitHub ↗

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")

Source from the content-addressed store, hash-verified

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,

Callers 1

include_routerMethod · 0.80

Calls 2

getMethod · 0.45

Tested by

no test coverage detected