danirus / django-comments-xtd

A pluggable Django comments application with thread support, follow-up notifications, mail confirmation, like/dislike flags, moderation, a ReactJS plugin and Bootstrap 5.3.
https://django-comments-xtd.readthedocs.io
BSD 2-Clause "Simplified" License
594 stars 158 forks source link

Customize operation ids #296

Closed ivanychev closed 3 years ago

ivanychev commented 3 years ago

Using standard REST Framework tools to generate OpenAPI schema leads to the warning

$ ./manage.py generateschema > openapi-schema.yml
/Users/sergeyivanychev/.local/share/virtualenvs/school-project-rI8dYCXm/lib/python3.9/site-packages/rest_framework/schemas/openapi.py:49: UserWarning: You have a duplicated operationId in your OpenAPI schema: createFlag
        Route: /comments/api/feedback/, Method: post
        Route: /comments/api/flag/, Method: post
        An operationId has to be unique across your schema. Your schema may not work in other tools.

This is caused by two similar API views with the same model names. This PR specifies different suffixes for the generated operation IDs so that there's no naming conflict.

danirus commented 3 years ago

Thank you @ivanychev, I will take a closer look during the weekend.

danirus commented 3 years ago

Thanks for the fix, @ivanychev.