Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/specify_cli/bundler/models/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ def _parse_tags(value: Any, entry_id: str) -> tuple[str, ...]:
raise BundlerError(
f"Catalog entry '{entry_id}': 'tags' must be a list of strings."
)
return tuple(str(t) for t in value)
if any(not isinstance(tag, str) for tag in value):
raise BundlerError(
f"Catalog entry '{entry_id}': 'tags' must be a list of strings."
)
return tuple(value)


def _parse_verified(value: Any, entry_id: str) -> bool:
Expand Down
9 changes: 9 additions & 0 deletions tests/contract/test_catalog_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ def test_catalog_entry_rejects_string_tags():
CatalogEntry.from_dict(data)


def test_catalog_entry_rejects_non_string_tag_members():
from specify_cli.bundler.models.catalog import CatalogEntry

data = catalog_entry_dict("demo")
data["tags"] = ["valid", 1]
with pytest.raises(BundlerError, match="'tags' must be a list of strings"):
CatalogEntry.from_dict(data)


def test_catalog_entry_rejects_non_boolean_verified():
from specify_cli.bundler.models.catalog import CatalogEntry

Expand Down