-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix: broken swagger and duplicate route #2050
Merged
deborahgu
merged 5 commits into
master
from
dkaplan1/APER-2531_make-credentials-swagger
Jun 27, 2023
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
77b185b
APER-2531 swagger and fixed route
deborahgu a2e12de
ran black to reformat
deborahgu 050b704
APER-2531 fixed namespace problem
deborahgu 49c7a6e
fix: broken swagger and duplicate route
deborahgu 0fdd31d
fix: broken swagger and duplicate route
deborahgu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
""" | ||
URLs for the credentials views. | ||
""" | ||
from django.conf.urls import include, url | ||
from django.urls import re_path | ||
|
||
from credentials.apps.credentials import views | ||
from credentials.apps.credentials.constants import UUID_PATTERN | ||
from credentials.apps.credentials.rest_api.v1 import urls as credentials_api_v1_urls | ||
|
||
|
||
urlpatterns = [ | ||
re_path(r"^example/$", views.ExampleCredential.as_view(), name="example"), | ||
re_path(rf"^example/{UUID_PATTERN}/$", views.RenderExampleProgramCredential.as_view(), name="render_example"), | ||
re_path(rf"^{UUID_PATTERN}/$", views.RenderCredential.as_view(), name="render"), | ||
url(r"^api/", include((credentials_api_v1_urls, "api"), namespace="api")), | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I don't believe this is a string. The
lms_user_id
is typically stored as an integer/number.If I try to use this via Swagger without making
lms_user_id
a String it will throw an error. However, if you try exercising the API through DRF, this is totally valid data:If you pass it as a String, it does the right thing though. I expect most times we won't be receiving it as a String, and I have a tiny concern about confusing people who may try to interact with the API via Swagger.