wps_forward_bot
🚀 New issue to wemake-services/django-modern-rest by @Izcarmt95
📝 OpenAPI: duplicated tags when both Router(tags=...) and @modify(tags=...) set the same tag (#1656)
When an operation has a tag in @modify(tags=...) and its Router has the same tag in Router(tags=...), the generated OpenAPI operation lists the tag twice. UIs like Scalar then show every operation twice, once per tag entry.
from dmr import Controller, modify
from dmr.openapi import build_schema
from dmr.plugins.pydantic import PydanticSerializer
from dmr.routing import Router, path
class UserController(Controller[PydanticSerializer]):
@modify(tags=['Users'])
def get(self) -> str:
return 'ok'
users = Router('/users', [path('/all', UserController.as_view(), name='users')], tags=['Users'])
api = Router('api')
api.include(users, namespace='users')
schema = build_schema(api)
print(schema.paths['/api/users/all'].get.tags) # ['Users', 'Users']
Expected: ['Users']. The router tags and the endpoint tags should be merged without duplicates.
This looks related to the change for #1299, which now propagates router metadata to included routes.
• django-modern-rest 0.15.0
• Django 5.2, Python 3.13
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
AI disclaimer: an AI assistant was used only to help write this issue.
#bug #good_first_issue #help_wanted #openapi #opensource_september #django_modern_rest
sent via relator
1 · 289 ·