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

Refactor get_users API to show proper swagger documentation #762

Merged
merged 2 commits into from
Jul 3, 2022

Conversation

iamsdas
Copy link
Contributor

@iamsdas iamsdas commented May 19, 2022

Refactor the get_users API (under facility) to make the user role (user_type) filter visible in the swagger UI.

Fixes: #711

@iamsdas iamsdas requested a review from a team as a code owner May 19, 2022 07:30
@gitguardian
Copy link

gitguardian bot commented May 20, 2022

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!


def get_queryset(self):
try:
facility = Facility.objects.get(external_id=self.kwargs.get("facility_external_id"))
Copy link
Member

Choose a reason for hiding this comment

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

@gigincg does this endpoint need authorisation?

Copy link
Member

Choose a reason for hiding this comment

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

@gigincg reminder.

care/facility/api/viewsets/facility_users.py Outdated Show resolved Hide resolved
care/facility/api/viewsets/facility_users.py Outdated Show resolved Hide resolved
@vigneshhari
Copy link
Member

you can also add swagger docs by using the fake schema generator that YASG provides


def get_queryset(self):
try:
facility = Facility.objects.get(external_id=self.kwargs.get("facility_external_id"))
Copy link
Member

Choose a reason for hiding this comment

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

@gigincg reminder.

@vigneshhari vigneshhari merged commit 0ed4b3d into coronasafe:master Jul 3, 2022
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.

Create a getDoctors API (get_users?role=DOCTOR&facility=HUBID
2 participants