forked from jazzband/djangorestframework-simplejwt
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Operation IDs have ugly prefixes that change across runs #79
Comments
@shmulvad Sorry for late response. I think what your proposal make sense. I will look into it. |
Also, you do know that |
This will be resolved in ninja-jwt new release. Sorry for the delay. Totally forgot about this |
eadwinCode
added a commit
that referenced
this issue
Jul 9, 2024
eadwinCode
added a commit
that referenced
this issue
Jul 9, 2024
This has been fixed with the new release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Django Ninja JWT does not explicitly set the operation ID parameter, so it is partially auto-generated. When the OpenAPI schema is generated, this results in ugly names for the operation IDs like
99fab5a9_controller_refresh_token
and1ba7e0e7_controller_verify_token
and so on. I would also argue thatcontroller
is an implementation detail and should not be a part of the name. My preferred operation IDs would simplyrefresh_token
,verify_token
and so on, very similar to what is already defined for theurl_name
.You could argue that these ugly operation IDs might not be a problem, but the reason I care is that I use codegen tools to generate a TypeScript schema for my frontend. The naming of the generated methods are based on the operation IDs, so this is a big issue. Also, the prefix seems to not be consistent across runs but change, which is an issue when re-running the codegen.
Proposed Solution
Explicitly set the
operation_id
parameter forTokenObtainPairController
,AsyncTokenObtainPairController
, etc. If you are worried about naming conflicts, the operation IDs could be prepended with some value the user defines in theNINJA_JWT
settings.The text was updated successfully, but these errors were encountered: