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:
parent
fdd42b8531
commit
160b35a591
2 changed files with 5 additions and 4 deletions
|
|
@ -133,7 +133,7 @@ SPECTACULAR_SETTINGS = {
|
|||
"url": f"https://api.{BASE_DOMAIN}/",
|
||||
"description": "Production Server",
|
||||
},
|
||||
{"url": "http://api.localhost:8000/", "description": "Development Server"},
|
||||
{"url": "http://localhost:8000/", "description": "Development Server"},
|
||||
],
|
||||
"CONTACT": {
|
||||
"name": 'Egor "fureunoir" Gorbunov',
|
||||
|
|
|
|||
|
|
@ -35,9 +35,10 @@ def camelize(obj: Any) -> Any:
|
|||
(_camelize_key(k) if isinstance(k, str) else k): camelize(v)
|
||||
for k, v in obj.items()
|
||||
}
|
||||
if isinstance(obj, (list, tuple)):
|
||||
t = type(obj)
|
||||
return t(camelize(v) for v in obj)
|
||||
if isinstance(obj, list):
|
||||
return [camelize(v) for v in obj]
|
||||
if isinstance(obj, tuple):
|
||||
return tuple(camelize(v) for v in obj)
|
||||
return obj
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue