fixup! Fix `NoneType` return type for 204 endpoints

This commit is contained in:
matiuszka 2023-01-09 11:44:00 +01:00
parent 151bf3e3dc
commit 2fb954e897
1 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ from typing import (
Union,
cast,
)
import types
import anyio
from fastapi import params
@ -278,7 +279,7 @@ def get_typed_return_annotation(call: Callable[..., Any]) -> Any:
globalns = getattr(call, "__globals__", {})
typed_annotation = get_typed_annotation(annotation, globalns)
if typed_annotation is type(None):
if typed_annotation is types.NoneType:
return None
return typed_annotation