| 1 |
from typing import Any |
| 2 |
|
| 3 |
|
| 4 |
def get_body_model_name(openapi: dict[str, Any], path: str) -> str: |
| 5 |
body = openapi["paths"][path]["post"]["requestBody"] |
| 6 |
body_schema = body["content"]["application/json"]["schema"] |
| 7 |
return body_schema.get("$ref", "").split("/")[-1] |