From 997c8269a729c9c523c9f739eb40d278ca12e808 Mon Sep 17 00:00:00 2001 From: Estelle Poulin Date: Fri, 23 Aug 2024 20:58:05 -0400 Subject: [PATCH] Pydantic issues --- rtex/__init__.py | 2 +- rtex/models.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtex/__init__.py b/rtex/__init__.py index 81f0fde..b1a19e3 100644 --- a/rtex/__init__.py +++ b/rtex/__init__.py @@ -1 +1 @@ -__version__ = "0.0.4" +__version__ = "0.0.5" diff --git a/rtex/models.py b/rtex/models.py index a3f91d8..06b61e8 100644 --- a/rtex/models.py +++ b/rtex/models.py @@ -1,6 +1,6 @@ from typing import Annotated, Literal, Optional, Union -from pydantic import BaseModel, Field, conint +from pydantic import BaseModel, Field, RootModel, conint RenderFormat = Literal["png", "jpg", "pdf"] RenderQuality = Annotated[int, conint(gt=0, le=100)] @@ -26,8 +26,8 @@ class CreateLaTeXDocumentErrorResponse(BaseModel): description: str -class CreateLaTeXDocumentResponse(BaseModel): - __root__: Union[ +class CreateLaTeXDocumentResponse(RootModel): + root: Union[ CreateLaTeXDocumentSuccessResponse, CreateLaTeXDocumentErrorResponse, ] = Field(discriminator="status")