mirror of https://github.com/tiangolo/fastapi.git
fixup! Fix `NoneType` return type for 204 endpoints
This commit is contained in:
parent
2fb954e897
commit
fd1e651357
|
|
@ -17,7 +17,6 @@ from typing import (
|
|||
Union,
|
||||
cast,
|
||||
)
|
||||
import types
|
||||
|
||||
import anyio
|
||||
from fastapi import params
|
||||
|
|
@ -279,7 +278,8 @@ def get_typed_return_annotation(call: Callable[..., Any]) -> Any:
|
|||
globalns = getattr(call, "__globals__", {})
|
||||
typed_annotation = get_typed_annotation(annotation, globalns)
|
||||
|
||||
if typed_annotation is types.NoneType:
|
||||
NoneType = type(None)
|
||||
if issubclass(typed_annotation, NoneType):
|
||||
return None
|
||||
|
||||
return typed_annotation
|
||||
|
|
|
|||
Loading…
Reference in New Issue