mirror of
https://github.com/StanGirard/quivr.git
synced 2024-09-11 13:15:41 +03:00
fix(backend): FastAPI docs broken due to missing schema for NullableUUID
(#739)
Just updates `NullableUUID` to extend from `UUID`. This lets FastAPI infer the correct field schema and resolves the /docs and /redocs endpoint failing to render Signed-off-by: Braden Mars <bradenmars@bradenmars.me>
This commit is contained in:
parent
97fd239980
commit
914689957d
@ -28,13 +28,14 @@ from utils.constants import (
|
|||||||
chat_router = APIRouter()
|
chat_router = APIRouter()
|
||||||
|
|
||||||
|
|
||||||
class NullableUUID:
|
class NullableUUID(UUID):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __get_validators__(cls):
|
def __get_validators__(cls):
|
||||||
yield cls.validate
|
yield cls.validate
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate(cls, v):
|
def validate(cls, v) -> UUID | None:
|
||||||
if v == "":
|
if v == "":
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user