Skip to content

Commit dc44ee7

Browse files
committed
fix: validate requires.tools entries in descriptor
1 parent 90e47f4 commit dc44ee7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/specify_cli/integrations/catalog.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,22 @@ def _validate(self) -> None:
516516
raise IntegrationDescriptorError(
517517
"requires.speckit_version must be a non-empty string"
518518
)
519+
tools = requires.get("tools")
520+
if tools is not None:
521+
if not isinstance(tools, list):
522+
raise IntegrationDescriptorError(
523+
"requires.tools must be a list"
524+
)
525+
for tool in tools:
526+
if not isinstance(tool, dict):
527+
raise IntegrationDescriptorError(
528+
"Each requires.tools entry must be a mapping"
529+
)
530+
tool_name = tool.get("name")
531+
if not isinstance(tool_name, str) or not tool_name.strip():
532+
raise IntegrationDescriptorError(
533+
"requires.tools entry 'name' must be a non-empty string"
534+
)
519535

520536
provides = self.data["provides"]
521537
if not isinstance(provides, dict):

0 commit comments

Comments
 (0)