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

Method _merge_component_schemas

robyn/openapi.py:361–376  ·  view source on GitHub ↗

Merge incoming component schemas into the spec with collision detection. If an incoming schema name already exists and the schemas differ, a warning is logged. The incoming schema always wins so that the most-recently-registered route's models are used (matching the

(self, incoming: dict)

Source from the content-addressed store, hash-verified

359 self.openapi_spec["paths"][modified_endpoint][route_type] = path_obj
360
361 def _merge_component_schemas(self, incoming: dict):
362 """Merge incoming component schemas into the spec with collision detection.
363
364 If an incoming schema name already exists and the schemas differ,
365 a warning is logged. The incoming schema always wins so that the
366 most-recently-registered route's models are used (matching the
367 behaviour of path registration).
368 """
369 existing = self.openapi_spec["components"]["schemas"]
370 for name, schema in incoming.items():
371 if name in existing and existing[name] != schema:
372 _logger.warning(
373 "OpenAPI component schema '%s' is defined by multiple models with different shapes — the later definition will be used",
374 name,
375 )
376 existing[name] = schema
377
378 def add_subrouter_paths(self, subrouter_openapi: "OpenAPI"):
379 """

Callers 3

add_subrouter_pathsMethod · 0.95
get_path_objMethod · 0.95
get_schema_objectMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected