don't allow extra inputs in theme settings

This commit is contained in:
Sina Atalay 2024-02-11 22:42:10 +01:00
parent 7887a23501
commit a7a4a943f2
3 changed files with 6 additions and 0 deletions

View File

@ -128,6 +128,8 @@ class ClassicThemeMargins(pydantic.BaseModel):
class ClassicThemeOptions(pydantic.BaseModel):
""" """
model_config = pydantic.ConfigDict(extra="forbid")
theme: Literal["classic"]
font: Literal["SourceSans3", "Roboto", "EBGaramond"] = pydantic.Field(
default="SourceSans3",

View File

@ -13,4 +13,6 @@ LaTeXDimension = Annotated[
class McdowellThemeOptions(pydantic.BaseModel):
""" """
model_config = pydantic.ConfigDict(extra="forbid")
theme: Literal["mcdowell"]

View File

@ -14,6 +14,8 @@ LaTeXDimension = Annotated[
class ModerncvThemeOptions(pydantic.BaseModel):
""" """
model_config = pydantic.ConfigDict(extra="forbid")
theme: Literal["moderncv"]
font_size: Literal["10pt", "11pt", "12pt"] = pydantic.Field(
default="10pt",