From 6c2a5b460ef5b8b012c4b7a9e33e871772fd9586 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 4 Feb 2026 07:14:03 +0100 Subject: [PATCH] feat: use `extra="forbid"` in annotation Validations this can be problematic if many users have additional data in their annotations. --- freqtrade/strategy/interface.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 34857c71e..935f9dfdd 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -1871,7 +1871,9 @@ class IStrategy(ABC, HyperStrategyMixin): if isinstance(annotation, dict): # Convert to AnnotationType try: - AnnotationTypeTA.validate_python(annotation) + # "forbid" extra fields to catch user errors + # Can be questioned if this creates many problems + AnnotationTypeTA.validate_python(annotation, extra="forbid") annotations_new.append(annotation) except ValidationError as e: logger.error(f"Invalid annotation data: {annotation}. Error: {e}")