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

[api][tools] Add swagger URL and UI for public APIs #3776

Merged
merged 11 commits into from
Jul 17, 2024
Merged

Conversation

tabraiz12
Copy link
Collaborator

@tabraiz12 tabraiz12 commented Jul 8, 2024

  1. API will be /api/swagger and /api/swagger
  2. login can be accessed without signing in but would require authentication for checking any api
  3. if logged in as an admin user can access any url

Add Swagger UI and URL for public url for easier QE Automation

Screenshot 2024-07-08 at 12 48 32 PM

How was this patch tested?

  • Manually Tested ui and json generation

Please review Hue Contributing Guide before opening a pull request.

@tabraiz12 tabraiz12 changed the title CDPD-71850 - SWAGGER URL and UI for easier QE Automation [tools] SWAGGER URL and UI for easier QE Automation Jul 8, 2024
@tabraiz12 tabraiz12 requested a review from ranade1 July 8, 2024 15:16
Copy link
Collaborator

@Harshg999 Harshg999 left a comment

Choose a reason for hiding this comment

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

Nice, almost!
Also did you test it out E2E?

desktop/core/base_requirements.txt Outdated Show resolved Hide resolved
desktop/core/src/desktop/urls.py Outdated Show resolved Hide resolved
desktop/core/src/desktop/urls.py Outdated Show resolved Hide resolved
@Harshg999 Harshg999 changed the title [tools] SWAGGER URL and UI for easier QE Automation [api][tools] Add swagger URL and UI for public APIs Jul 8, 2024
@tabraiz12
Copy link
Collaborator Author

Nice, almost! Also did you test it out E2E?

yes, i have tested this out.

desktop/core/base_requirements.txt Outdated Show resolved Hide resolved
desktop/core/src/desktop/urls.py Outdated Show resolved Hide resolved
desktop/core/src/desktop/urls.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Harshg999 Harshg999 left a comment

Choose a reason for hiding this comment

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

Few more review comments. Also please fix the linting issues flagged by CI checks.

@@ -202,6 +203,9 @@
]

dynamic_patterns += [
re_path('api/schema', SpectacularAPIView.as_view(),name='schema'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can remove this mapping as well, I checked and its just downloading the schema for all the APIs. Is this required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, we require this for QE.

Copy link
Collaborator

@Harshg999 Harshg999 Jul 10, 2024

Choose a reason for hiding this comment

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

@tabraiz12 Can we change the mapping here to '^api/schema/?$'?

desktop/core/src/desktop/urls.py Outdated Show resolved Hide resolved
desktop/core/src/desktop/settings.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Harshg999 Harshg999 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for addressing all the review comments.

@Harshg999 Harshg999 enabled auto-merge (squash) July 10, 2024 18:20
Copy link
Contributor

@JohanAhlen JohanAhlen left a comment

Choose a reason for hiding this comment

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

LGTM!

tabraiz and others added 11 commits July 17, 2024 20:59
Change-Id: I2af75fd420ba84d6fa85a8af92013b59d60c054e
Change-Id: I738895667d7ef90794c3d5ec2ecf70a7cdcbdeeb
Change-Id: I080794b1d9937d8f4474d80757e0e5f299d3ea51
This reverts commit 8ea41bb.
This reverts commit 255e034.
Change-Id: I9be2abda3c2af2e04dd63248bb084fa45f80d4fa
Change-Id: I34e3aa43f1905ac9cf901c1ce448071c61c459d5
Change-Id: Ic1fce350d5a1e526e26e12c4b626dfd54ea352c9
Change-Id: If0d3f5744f06262a7d0723d7939670a8abdb5a41
@Harshg999 Harshg999 merged commit 034e6fd into master Jul 17, 2024
4 of 5 checks passed
@Harshg999 Harshg999 deleted the CDPD-71850 branch July 17, 2024 15:49
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.

3 participants