request_bodies = self._request_bodies_strict
            if ref_name not in request_bodies:
                raise ValueError(f"No request body found for {ref_name}")
            return request_bodies[ref_name]
        def _get_root_referenced_request_body(
            self, ref: Reference
        ) -> Optional[RequestBody]:
            """Get the root request Body or err."""
            from openapi_schema_pydantic import Reference
            request_body = self._get_referenced_request_body(ref)
            while isinstance(request_body, Reference):
                request_body = self._get_referenced_request_body(request_body)
            return request_body
        @staticmethod
        def _alert_unsupported_spec(obj: dict) -> None:
            """Alert if the spec is not supported."""
            warning_message = (
                " This may result in degraded performance."
                + " Convert your OpenAPI spec to 3.1.* spec"
                + " for better support."
            )
            swagger_version = obj.get("swagger")
            openapi_version = obj.get("openapi")
            if isinstance(openapi_version, str):
                if openapi_version != "3.1.0":
                    logger.warning(
                        f"Attempting to load an OpenAPI {openapi_version}"
                        f" spec. {warning_message}"
                    )
                else:
                    pass
            elif isinstance(swagger_version, str):
                logger.warning(
                    f"Attempting to load a Swagger {swagger_version}"
                    f" spec. {warning_message}"
                )
            else:
                raise ValueError(
                    "Attempting to load an unsupported spec:"
                    f"\n\n{obj}\n{warning_message}"
                )
[docs]        @classmethod
        def parse_obj(cls, obj: dict) -> OpenAPISpec: