Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openapi custom operation name #7190

Merged
merged 6 commits into from
Mar 2, 2020

Conversation

gnuletik
Copy link
Contributor

This PR allow the user to customize the operationId's name.
It fixes the subtask " Allow setting a custom operation ID on views with an attribute?" defined here #6549

Thanks !

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gnuletik.

I think this is a good step.

  • Let's promote _get_operation_id() to get_operation_id() and document it to be overridden.
  • Then add get_operation_id_base(), which just allows people to add logic instead of using the model name.
  • Then call the __init__() kwarg operation_id_base.

Make sense? I think that will give the right level of flexibility for the future.

@carltongibson carltongibson added this to the 3.12 Release milestone Feb 19, 2020
@gnuletik gnuletik force-pushed the openapi-custom-operation-name branch from 8bebf03 to a36232a Compare February 20, 2020 15:20
@gnuletik
Copy link
Contributor Author

Hi @carltongibson,

Thanks for the feedback!
Yep, your changes makes sense! I updated the PR and rebased on master.

@dhaval-mehta
Copy link
Contributor

Hi, @gnuletik, My PR(#7184) got merged. Due to it, you have merge conflicts. If you need any help to resolve merge conflicts, feel free to comment & mention me.

* rename operation_name with operation_id_base
* add get_operation_id_base
* get_operation_id not private
* update docs
* update tests
@gnuletik gnuletik force-pushed the openapi-custom-operation-name branch from a36232a to 03d3406 Compare February 28, 2020 17:05
@gnuletik
Copy link
Contributor Author

Thanks for the heads up @dhaval-mehta !
I rebased the PR on master :)

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super. Thank looks great @gnuletik. 🥇

@carltongibson carltongibson merged commit 5b16a17 into encode:master Mar 2, 2020
@gnuletik gnuletik deleted the openapi-custom-operation-name branch March 2, 2020 17:01
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants