mirror of
https://github.com/StanGirard/quivr.git
synced 2024-08-17 09:00:33 +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()
|
||||
|
||||
|
||||
class NullableUUID:
|
||||
class NullableUUID(UUID):
|
||||
|
||||
@classmethod
|
||||
def __get_validators__(cls):
|
||||
yield cls.validate
|
||||
|
||||
@classmethod
|
||||
def validate(cls, v):
|
||||
def validate(cls, v) -> UUID | None:
|
||||
if v == "":
|
||||
return None
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user