14 lines
577 B
Python
14 lines
577 B
Python
# core/spectacular_hooks.py
|
|
def rename_djoser_tags(result, generator, request, public):
|
|
"""
|
|
เปลี่ยน Tag 'v1' ของ Djoser ให้เป็นชื่อ Tag ที่ต้องการ
|
|
"""
|
|
# result คือ OpenAPI spec เป็น dict
|
|
paths = result.get('paths', {})
|
|
for path, path_item in paths.items():
|
|
for method, operation in path_item.items():
|
|
tags = operation.get('tags', [])
|
|
if 'v1' in tags:
|
|
operation['tags'] = ['1. Authentication & User Management']
|
|
return result
|