# replace_defs_in_schema

> **Function** in `langchain_google_vertexai`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-vertexai/_utils/replace_defs_in_schema)

Given an OpenAPI schema with a property `$defs` replaces all occurrences of
referenced items in the dictionary.

## Signature

```python
replace_defs_in_schema(
    original_schema: dict,
    defs: dict | None = None,
) -> dict
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `original_schema` | `dict` | Yes | Schema generated by `BaseModel.model_schema_json` |
| `defs` | `dict \| None` | No | Definitions for recursive calls. (default: `None`) |

## Returns

`dict`

Schema with refs replaced.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/vertexai/langchain_google_vertexai/_utils.py#L292)