mirror of https://github.com/tiangolo/fastapi.git
files formatting
This commit is contained in:
parent
7514ac6fb0
commit
eda9b28338
|
|
@ -148,9 +148,11 @@ class APIRoute(routing.Route):
|
|||
existed_codes.append(add_response.status_code)
|
||||
response_models: List[Any] = [m for m in add_response.models]
|
||||
schema_field = None
|
||||
if add_response.content_type == "application/json" or lenient_issubclass(
|
||||
content_type, JSONResponse
|
||||
) and len(response_models):
|
||||
if (
|
||||
add_response.content_type == "application/json"
|
||||
or lenient_issubclass(content_type, JSONResponse)
|
||||
and len(response_models)
|
||||
):
|
||||
schema_field = Field(
|
||||
name=f"Additional_response_{add_response.status_code}",
|
||||
type_=Union[tuple(response_models)],
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import pytest
|
|||
from fastapi import FastAPI
|
||||
from fastapi.openapi.models import AdditionalResponse
|
||||
from pydantic import BaseModel
|
||||
from pydantic.error_wrappers import ValidationError
|
||||
from starlette.responses import JSONResponse
|
||||
from starlette.testclient import TestClient
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue