Skip to content
Merged
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
27 changes: 27 additions & 0 deletions tests/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}}})
Expand Down
Loading