Features: (1) Update camelize function to separately handle lists and tuples for improved clarity;

Fixes: (1) Correct development server URL in DRF settings from `http://api.localhost:8000/` to `http://localhost:8000/`;

Extra: (1) Minor alignment adjustments in `renderers.py` for better readability.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-12-18 19:36:05 +03:00
parent fdd42b8531
commit 160b35a591
2 changed files with 5 additions and 4 deletions

View file

@ -133,7 +133,7 @@ SPECTACULAR_SETTINGS = {
"url": f"https://api.{BASE_DOMAIN}/", "url": f"https://api.{BASE_DOMAIN}/",
"description": "Production Server", "description": "Production Server",
}, },
{"url": "http://api.localhost:8000/", "description": "Development Server"}, {"url": "http://localhost:8000/", "description": "Development Server"},
], ],
"CONTACT": { "CONTACT": {
"name": 'Egor "fureunoir" Gorbunov', "name": 'Egor "fureunoir" Gorbunov',

View file

@ -35,9 +35,10 @@ def camelize(obj: Any) -> Any:
(_camelize_key(k) if isinstance(k, str) else k): camelize(v) (_camelize_key(k) if isinstance(k, str) else k): camelize(v)
for k, v in obj.items() for k, v in obj.items()
} }
if isinstance(obj, (list, tuple)): if isinstance(obj, list):
t = type(obj) return [camelize(v) for v in obj]
return t(camelize(v) for v in obj) if isinstance(obj, tuple):
return tuple(camelize(v) for v in obj)
return obj return obj