Skip to content

Commit

Permalink
Set meta to be Dict and add Literal type hint to document model
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhorton committed Oct 29, 2021
1 parent 5a28d00 commit f5dcbfe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mp_api/routes/_general_store/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pydantic import BaseModel, Field
from typing import Dict, Literal
from datetime import datetime


Expand All @@ -7,11 +8,13 @@ class GeneralStoreDoc(BaseModel):
Defines general store data
"""

kind: str = Field(None, description="Type of the data.")
kind: Literal["newsfeed", "seminar", "banner"] = Field(
None, description="Type of the data."
)

markdown: str = Field(None, description="Markdown data.")

meta: str = Field(None, description="Metadata.")
meta: Dict = Field(None, description="Metadata.")

last_updated: datetime = Field(
description="Timestamp for when this document was last updated",
Expand Down

0 comments on commit f5dcbfe

Please sign in to comment.