|
|
|
@ -1,5 +1,6 @@ |
|
|
|
from typing import Any, Dict, Union |
|
|
|
|
|
|
|
from dirty_equals import IsDict |
|
|
|
from fastapi import FastAPI |
|
|
|
from fastapi.testclient import TestClient |
|
|
|
from inline_snapshot import snapshot |
|
|
|
@ -92,11 +93,21 @@ def test_discriminator_pydantic_v2() -> None: |
|
|
|
"description": "Successful Response", |
|
|
|
"content": { |
|
|
|
"application/json": { |
|
|
|
"schema": { |
|
|
|
"type": "object", |
|
|
|
"additionalProperties": True, |
|
|
|
"title": "Response Save Union Body Discriminator Items Post", |
|
|
|
} |
|
|
|
"schema": IsDict( |
|
|
|
{ |
|
|
|
# Pydantic 2.10, in Python 3.8 |
|
|
|
# TODO: remove when dropping support for Python 3.8 |
|
|
|
"type": "object", |
|
|
|
"title": "Response Save Union Body Discriminator Items Post", |
|
|
|
} |
|
|
|
) |
|
|
|
| IsDict( |
|
|
|
{ |
|
|
|
"type": "object", |
|
|
|
"additionalProperties": True, |
|
|
|
"title": "Response Save Union Body Discriminator Items Post", |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|