-
Notifications
You must be signed in to change notification settings - Fork 32
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
Update views.py- Added missing GET request parameters to swagger #734
base: master
Are you sure you want to change the base?
Conversation
core/orgs/views.py
Outdated
@swagger_auto_schema(manual_parameters=[org_no_members_param]) | ||
@swagger_auto_schema( | ||
manual_parameters=[ | ||
openapi.Parameter('user', openapi.IN_PATH, description="Filter by username", type=openapi.TYPE_STRING), |
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.
user
param in path cannot be added here. That comes from routes (urls.py), if you check users/urls.py its already added there. This will have no effect in the results and also its not mandatory.
core/orgs/views.py
Outdated
manual_parameters=[ | ||
openapi.Parameter('user', openapi.IN_PATH, description="Filter by username", type=openapi.TYPE_STRING), | ||
openapi.Parameter(NO_MEMBERS, openapi.IN_QUERY, description="Filter organizations with no members", type=openapi.TYPE_BOOLEAN), | ||
openapi.Parameter('updated_since', openapi.IN_QUERY, description="Filter by update date", type=openapi.TYPE_STRING, format=openapi.FORMAT_DATETIME), |
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.
updated_since
-- updatedSince
--> UPDATED_SINCE_PARAM
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.
Kindly provide more context
core/orgs/views.py
Outdated
openapi.Parameter('user', openapi.IN_PATH, description="Filter by username", type=openapi.TYPE_STRING), | ||
openapi.Parameter(NO_MEMBERS, openapi.IN_QUERY, description="Filter organizations with no members", type=openapi.TYPE_BOOLEAN), | ||
openapi.Parameter('updated_since', openapi.IN_QUERY, description="Filter by update date", type=openapi.TYPE_STRING, format=openapi.FORMAT_DATETIME), | ||
openapi.Parameter(UPDATED_BY_USERNAME_PARAM, openapi.IN_QUERY, description="Filter by username of user who updated", type=openapi.TYPE_STRING), |
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.
description=Filter Orgs by the update by user
core/orgs/views.py
Outdated
|
||
@swagger_auto_schema( | ||
manual_parameters=[ | ||
openapi.Parameter('org', openapi.IN_PATH, description="Organization mnemonic", type=openapi.TYPE_STRING, required=True), |
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.
org
is already part of this API /orgs/{org}/logo/
path. This will have no effect.
core/orgs/views.py
Outdated
class OrganizationExtrasView(OrganizationExtrasBaseView): | ||
serializer_class = OrganizationDetailSerializer | ||
|
||
@swagger_auto_schema( | ||
manual_parameters=[ | ||
openapi.Parameter('org', openapi.IN_PATH, description="Organization mnemonic", type=openapi.TYPE_STRING, required=True), |
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.
same as prev
core/orgs/views.py
Outdated
class OrganizationExtraRetrieveUpdateDestroyView(OrganizationExtrasBaseView, RetrieveUpdateDestroyAPIView): | ||
serializer_class = OrganizationDetailSerializer | ||
|
||
@swagger_auto_schema( | ||
manual_parameters=[ | ||
openapi.Parameter('org', openapi.IN_PATH, description="Organization mnemonic", type=openapi.TYPE_STRING, required=True), |
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.
same as prev
core/orgs/views.py
Outdated
@swagger_auto_schema( | ||
manual_parameters=[ | ||
openapi.Parameter('org', openapi.IN_PATH, description="Organization mnemonic", type=openapi.TYPE_STRING, required=True), | ||
openapi.Parameter('extra', openapi.IN_PATH, description="Extra field key", type=openapi.TYPE_STRING, required=True), |
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.
same as prev
core/orgs/views.py
Outdated
@@ -286,6 +357,25 @@ def retrieve(self, request, *args, **kwargs): | |||
|
|||
return Response({'detail': NOT_FOUND}, status=status.HTTP_404_NOT_FOUND) | |||
|
|||
@swagger_auto_schema( | |||
manual_parameters=[ | |||
openapi.Parameter('org', openapi.IN_PATH, description="Organization mnemonic", type=openapi.TYPE_STRING, required=True), |
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.
same as prev
core/orgs/views.py
Outdated
@@ -299,6 +389,16 @@ def update(self, request, **kwargs): # pylint: disable=arguments-differ | |||
instance.set_checksums() | |||
return Response({key: value}) | |||
|
|||
@swagger_auto_schema( | |||
manual_parameters=[ |
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.
same as prev
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.
In general, there are many newlines changes, please revert those
core/orgs/views.py
Outdated
@@ -286,6 +293,8 @@ def retrieve(self, request, *args, **kwargs): | |||
|
|||
return Response({'detail': NOT_FOUND}, status=status.HTTP_404_NOT_FOUND) | |||
|
|||
|
|||
) |
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.
feels like a typo, not needed
core/orgs/views.py
Outdated
@@ -299,6 +308,7 @@ def update(self, request, **kwargs): # pylint: disable=arguments-differ | |||
instance.set_checksums() | |||
return Response({key: value}) | |||
|
|||
|
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.
not needed
No description provided.