Skip to content

Commit 7ce210f

Browse files
authored
Merge pull request #112 from ghazi-git/require-latest-drf-spectacular
require-latest-drf-spectacular
2 parents 456bce1 + 58060eb commit 7ce210f

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

docs/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88
### Added
99
- add support for python 3.14
1010

11+
### Changed (backward-incompatible)
12+
- set minimum version of drf-spectacular to 0.29.0
13+
1114
## [0.15.0] - 2025-06-09
1215
### Added
1316
- add support for python 3.13

drf_standardized_errors/openapi_hooks.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# since it's a copy of drf-spectacular postprocessing hook
33
import re
44
from collections import defaultdict
5+
from collections.abc import MutableMapping
56

67
from drf_spectacular.hooks import postprocess_schema_enum_id_removal
78
from drf_spectacular.plumbing import (
@@ -83,8 +84,8 @@ def extract_hash(schema):
8384
for component_name, props in iter_prop_containers(schemas):
8485
for prop_name, prop_schema in props.items():
8586
if prop_schema.get("type") == "array":
86-
prop_schema = prop_schema.get("items", {})
87-
if "enum" not in prop_schema:
87+
prop_schema = prop_schema.get("items")
88+
if not isinstance(prop_schema, MutableMapping) or "enum" not in prop_schema:
8889
continue
8990

9091
prop_enum_cleaned_hash = extract_hash(prop_schema)
@@ -138,9 +139,9 @@ def extract_hash(schema):
138139
for prop_name, prop_schema in props.items():
139140
is_array = prop_schema.get("type") == "array"
140141
if is_array:
141-
prop_schema = prop_schema.get("items", {})
142+
prop_schema = prop_schema.get("items")
142143

143-
if "enum" not in prop_schema:
144+
if not isinstance(prop_schema, MutableMapping) or "enum" not in prop_schema:
144145
continue
145146

146147
prop_enum_original_list = prop_schema["enum"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ release = [
6060
"tbump",
6161
]
6262
openapi = [
63-
"drf-spectacular>=0.27.1",
63+
"drf-spectacular>=0.29.0",
6464
"inflection",
6565
]
6666

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ python =
3030
deps =
3131
pytest
3232
pytest-django
33-
drf-spectacular>=0.27.1
33+
drf-spectacular>=0.29.0
3434
django-filter
3535
dj32: Django>=3.2,<4.0
3636
dj40: Django>=4.0,<4.1

0 commit comments

Comments
 (0)