diff --git a/pyproject.toml b/pyproject.toml index 213cd1c..0099ee7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [ "typer>=0.9.0", diff --git a/tests/test_diff.py b/tests/test_diff.py index 7f262bd..f9f21eb 100644 --- a/tests/test_diff.py +++ b/tests/test_diff.py @@ -546,6 +546,33 @@ def test_enum_values_removed_breaking(self): result = diff_specs(old, new) assert any(c.kind == "enum_values_removed" for c in result.changes) + def test_property_enum_values_removed_breaking(self): + """Property-level enum value removed is detected as breaking.""" + old = _make_spec(schemas={ + "Status": { + "type": "object", + "properties": { + "state": { + "type": "string", + "enum": ["active", "inactive", "pending"], + }, + }, + }, + }) + new = _make_spec(schemas={ + "Status": { + "type": "object", + "properties": { + "state": { + "type": "string", + "enum": ["active", "inactive"], + }, + }, + }, + }) + result = diff_specs(old, new) + assert any(c.kind == "enum_values_removed" for c in result.changes) + def test_no_schema_changes(self): old = _make_spec(schemas={"User": {"type": "object", "properties": {"id": {"type": "string"}}}}) new = _make_spec(schemas={"User": {"type": "object", "properties": {"id": {"type": "string"}}}})