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

Update views.py- Added missing GET request parameters to swagger #734

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

WestOnyinsi
Copy link
Contributor

No description provided.

@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),
Copy link
Contributor

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.

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),
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kindly provide more context

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),
Copy link
Contributor

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 Show resolved Hide resolved

@swagger_auto_schema(
manual_parameters=[
openapi.Parameter('org', openapi.IN_PATH, description="Organization mnemonic", type=openapi.TYPE_STRING, required=True),
Copy link
Contributor

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.

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),
Copy link
Contributor

Choose a reason for hiding this comment

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

same as prev

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),
Copy link
Contributor

Choose a reason for hiding this comment

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

same as prev

@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),
Copy link
Contributor

Choose a reason for hiding this comment

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

same as prev

@@ -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),
Copy link
Contributor

Choose a reason for hiding this comment

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

same as prev

@@ -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=[
Copy link
Contributor

Choose a reason for hiding this comment

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

same as prev

Copy link
Contributor

@snyaggarwal snyaggarwal left a 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 Show resolved Hide resolved
@@ -286,6 +293,8 @@ def retrieve(self, request, *args, **kwargs):

return Response({'detail': NOT_FOUND}, status=status.HTTP_404_NOT_FOUND)


)
Copy link
Contributor

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

@@ -299,6 +308,7 @@ def update(self, request, **kwargs): # pylint: disable=arguments-differ
instance.set_checksums()
return Response({key: value})


Copy link
Contributor

Choose a reason for hiding this comment

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

not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants