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
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- add support for python 3.14

### Changed (backward-incompatible)
- set minimum version of drf-spectacular to 0.29.0

## [0.15.0] - 2025-06-09
### Added
- add support for python 3.13
Expand Down
9 changes: 5 additions & 4 deletions drf_standardized_errors/openapi_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# since it's a copy of drf-spectacular postprocessing hook
import re
from collections import defaultdict
from collections.abc import MutableMapping

from drf_spectacular.hooks import postprocess_schema_enum_id_removal
from drf_spectacular.plumbing import (
Expand Down Expand Up @@ -83,8 +84,8 @@ def extract_hash(schema):
for component_name, props in iter_prop_containers(schemas):
for prop_name, prop_schema in props.items():
if prop_schema.get("type") == "array":
prop_schema = prop_schema.get("items", {})
if "enum" not in prop_schema:
prop_schema = prop_schema.get("items")
if not isinstance(prop_schema, MutableMapping) or "enum" not in prop_schema:
continue

prop_enum_cleaned_hash = extract_hash(prop_schema)
Expand Down Expand Up @@ -138,9 +139,9 @@ def extract_hash(schema):
for prop_name, prop_schema in props.items():
is_array = prop_schema.get("type") == "array"
if is_array:
prop_schema = prop_schema.get("items", {})
prop_schema = prop_schema.get("items")

if "enum" not in prop_schema:
if not isinstance(prop_schema, MutableMapping) or "enum" not in prop_schema:
continue

prop_enum_original_list = prop_schema["enum"]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ release = [
"tbump",
]
openapi = [
"drf-spectacular>=0.27.1",
"drf-spectacular>=0.29.0",
"inflection",
]

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ python =
deps =
pytest
pytest-django
drf-spectacular>=0.27.1
drf-spectacular>=0.29.0
django-filter
dj32: Django>=3.2,<4.0
dj40: Django>=4.0,<4.1
Expand Down
Loading