Reject heading_level and named_style_type together in validation
Add mutual exclusion guard so clients get a clear error instead of named_style_type silently overriding heading_level. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -316,6 +316,12 @@ class ValidationManager:
|
|||||||
"At least one paragraph style parameter must be provided (heading_level, alignment, line_spacing, indent_first_line, indent_start, indent_end, space_above, space_below, or named_style_type)",
|
"At least one paragraph style parameter must be provided (heading_level, alignment, line_spacing, indent_first_line, indent_start, indent_end, space_above, space_below, or named_style_type)",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if heading_level is not None and named_style_type is not None:
|
||||||
|
return (
|
||||||
|
False,
|
||||||
|
"heading_level and named_style_type are mutually exclusive; provide only one",
|
||||||
|
)
|
||||||
|
|
||||||
if named_style_type is not None:
|
if named_style_type is not None:
|
||||||
valid_styles = [
|
valid_styles = [
|
||||||
"NORMAL_TEXT", "TITLE", "SUBTITLE",
|
"NORMAL_TEXT", "TITLE", "SUBTITLE",
|
||||||
|
|||||||
Reference in New Issue
Block a user