From 306e34847549f76519edf5533ee86ccc414ab576 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Thu, 23 Nov 2023 10:35:19 +0100 Subject: [PATCH] ProductBase: add description --- app/schemas.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/schemas.py b/app/schemas.py index 5483905a..950efbf4 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -37,12 +37,19 @@ class ProductCreate(BaseModel): class ProductBase(ProductCreate): id: int - source: Flavor | None - product_name: str | None - product_quantity: int | None - image_url: AnyHttpUrl | None - created: datetime.datetime - updated: datetime.datetime | None + source: Flavor | None = Field( + description="source of data, either `off` (Open Food Facts), " + "`obf` (Open Beauty Facts), `opff` (Open Pet Food Facts) or `obf` (Open Beauty Facts)" + ) + product_name: str | None = Field(description="name of the product.") + product_quantity: int | None = Field( + description="quantity of the product, normalized in g or mL (depending on the product)." + ) + image_url: AnyHttpUrl | None = Field(description="URL of the product image.") + created: datetime.datetime = Field(description="datetime of the creation.") + updated: datetime.datetime | None = Field( + description="datetime of the last update." + ) class LocationCreate(BaseModel):