8000 feat: serve swagger UI in LocalStack by giograno · Pull Request #11509 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

feat: serve swagger UI in LocalStack #11509

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

Merged
merged 11 commits into from
Sep 20, 2024
Merged

feat: serve swagger UI in LocalStack #11509

merged 11 commits into from
Sep 20, 2024

Conversation

giograno
Copy link
Member
@giograno giograno commented Sep 12, 2024

Motivation

We recently introduced OpenAPI specs for different LocalStack packages (localstack and localstack.pro.core at the moment).
These specs document all the internal developer endpoints we serve in LocalStack.
To allow users to navigate those specs, we want to serve the SwaggerUI directly within LocalStack.

Changes

  • Build some logic around our OAS plugin system (introduce plugins to load openapi specs #11497) that collects at runtime all the available specs and merges them.
  • Adding a new endpoint (http://localhost.localstack.cloud:4566/_localstack/swagger) that serves built OAS spec with a SwaggerUI. The UI is rendered with jinja2 and lives in the localstack.static package.

@giograno giograno added the semver: patch Non-breaking changes which can be included in patch releases label Sep 12, 2024
@giograno giograno self-assigned this Sep 12, 2024
Copy link
github-actions bot commented Sep 12, 2024

S3 Image Test Results (AMD64 / ARM64)

  2 files    2 suites   3m 28s ⏱️
423 tests 369 ✅  54 💤 0 ❌
846 runs  738 ✅ 108 💤 0 ❌

Results for commit 0b93328.

♻️ This comment has been updated with latest results.

Copy link
github-actions bot commented Sep 12, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 38m 55s ⏱️ + 1m 2s
3 439 tests +1  3 041 ✅ +2  398 💤  - 1  0 ❌ ±0 
3 441 runs  +1  3 041 ✅ +2  400 💤  - 1  0 ❌ ±0 

Results for commit 0b93328. ± Comparison against base commit 1786ed9.

♻️ This comment has been updated with latest results.

@giograno giograno force-pushed the serve-swagger branch 2 times, most recently from f35487b to 0f44ccc Compare September 18, 2024 14:46
@giograno giograno marked this pull request as ready for review September 18, 2024 15:09
	added localstack.http.resources.swagger
	all the swagger stuff in there
@giograno giograno marked this pull request as draft September 19, 2024 00:55
@giograno
Copy link
Member Author

@thrau I opted to create a swagger package in localstack.http.resources. We might also later move internals.py to localstack.http.resources if you agree (it requires some coordination with ext). What do you think?
Thanks to the suggestion of @viren-nadkarni we could get rid of the static package at all.

@giograno giograno marked this pull request as ready for review September 19, 2024 14:06
@giograno giograno removed the request for review from dominikschubert September 19, 2024 14:18
@giograno giograno removed the request for review from dfangl September 19, 2024 14:18
@thrau
Copy link
Member
thrau commented Sep 19, 2024

@thrau I opted to create a swagger package in localstack.http.resources. We might also later move internals.py to localstack.http.resources if you agree (it requires some coordination with ext). What do you think? Thanks to the suggestion of @viren-nadkarni we could get rid of the static package at all.

i think this is good for now! that said, the http package was originally really meant as the package for our http framework library. anything concrete such as internal endpoints, should actually be part of some services/application package, which is currently only localstack.services. so i think ultimately we're missing something, but for now localstack.http seems fine to me, since your code is enabling more concrete things!

Copy link
Member
@thrau thrau left a comment

Choose a reason for hiding this comment

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

nice! looking forward to seeing this in action :-)

@thrau thrau merged commit 7c0c409 into master Sep 20, 2024
41 checks passed
@thrau thrau deleted the serve-swagger branch September 20, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0