From a7a4a943f2e1f9aa23842faea8bb2b805800374f Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Sun, 11 Feb 2024 22:42:10 +0100 Subject: [PATCH] don't allow extra inputs in theme settings --- rendercv/themes/classic/__init__.py | 2 ++ rendercv/themes/mcdowell/__init__.py | 2 ++ rendercv/themes/moderncv/__init__.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/rendercv/themes/classic/__init__.py b/rendercv/themes/classic/__init__.py index 8127ce9..acd6042 100644 --- a/rendercv/themes/classic/__init__.py +++ b/rendercv/themes/classic/__init__.py @@ -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", diff --git a/rendercv/themes/mcdowell/__init__.py b/rendercv/themes/mcdowell/__init__.py index 3565000..8ada56c 100644 --- a/rendercv/themes/mcdowell/__init__.py +++ b/rendercv/themes/mcdowell/__init__.py @@ -13,4 +13,6 @@ LaTeXDimension = Annotated[ class McdowellThemeOptions(pydantic.BaseModel): """ """ + model_config = pydantic.ConfigDict(extra="forbid") + theme: Literal["mcdowell"] diff --git a/rendercv/themes/moderncv/__init__.py b/rendercv/themes/moderncv/__init__.py index bf31997..9d49b69 100644 --- a/rendercv/themes/moderncv/__init__.py +++ b/rendercv/themes/moderncv/__init__.py @@ -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",