Skip to content

Commit

Permalink
ProductBase: add description
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 23, 2023
1 parent 1b92a04 commit 306e348
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions app/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 306e348

Please sign in to comment.