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

Feature request: Add ability to expose a Swagger UI on the event handler #3253

Closed
2 tasks done
rubenfonseca opened this issue Oct 25, 2023 · 2 comments · Fixed by #3254
Closed
2 tasks done

Feature request: Add ability to expose a Swagger UI on the event handler #3253

rubenfonseca opened this issue Oct 25, 2023 · 2 comments · Fixed by #3254
Assignees
Labels

Comments

@rubenfonseca
Copy link
Contributor

rubenfonseca commented Oct 25, 2023

Use case

This is a continuation of the work on the RFC #2421

Now that we've merged the code to add OpenAPI generation and runtime validation, we want to optionally enable a Swagger UI so the consumers can explore the API provided by the Lambda function.

NOTE: this ticket is not yet for customers using micro-functions. This is only useful for customers with a single Lambda with many routes.

Solution/User Experience

See here for the discussion.

We should create a new enable_swagger method on all the API resolvers that will create all the necessary endpoints to server the Swagger UI. Optionally the user can pass middlewares if additional security / authorization is needed.

app = APIGatewayRestResolver(enable_validation=True)
app.enable_swagger(path="/swagger")

Additional features include:

  • ability to override the Swagger base path, so other versions can be saved
  • ability to customize the OpenAPI metadata
  • automatic detection of the base path for Rest/Http gateways

Alternative solutions

N/A

Acknowledgment

@rubenfonseca rubenfonseca added triage Pending triage from maintainers feature-request feature request labels Oct 25, 2023
@rubenfonseca rubenfonseca self-assigned this Oct 25, 2023
@rubenfonseca rubenfonseca linked a pull request Oct 25, 2023 that will close this issue
7 tasks
@leandrodamascena leandrodamascena added event_handlers and removed triage Pending triage from maintainers labels Oct 25, 2023
Copy link
Contributor

github-actions bot commented Nov 6, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Nov 6, 2023
Copy link
Contributor

This is now released under 2.26.1 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Shipped
Development

Successfully merging a pull request may close this issue.

2 participants