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(event-handler): Inject CSS and JS files into SwaggerUI route when no custom CDN is used. #3562

Merged
merged 6 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/core/event_handler/api_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ There are some important **caveats** that you should know before enabling it:
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Swagger UI is **publicly accessible by default** | When using `enable_swagger` method, you can [protect sensitive API endpoints by implementing a custom middleware](#customizing-swagger-ui) using your preferred authorization mechanism. |
| **No micro-functions support** yet | Swagger UI is enabled on a per resolver instance which will limit its accuracy here. |
| You need to expose **new routes** | You'll need to expose the following paths to Lambda: `/swagger`, `/swagger.css`, `/swagger.js`; ignore if you're routing all paths already. |
| You need to expose **new route** | You'll need to expose the following paths to Lambda: `/swagger`; ignore if you're routing this path already. |
leandrodamascena marked this conversation as resolved.
Show resolved Hide resolved

```python hl_lines="12-13" title="enabling_swagger.py"
--8<-- "examples/event_handler_rest/src/enabling_swagger.py"
Expand Down
10 changes: 0 additions & 10 deletions examples/event_handler_rest/sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,3 @@ Resources:
# Properties:
# Path: /swagger
# Method: GET
# SwaggerUICSS:
# Type: Api
# Properties:
# Path: /swagger.css
# Method: GET
# SwaggerUIJS:
# Type: Api
# Properties:
# Path: /swagger.js
# Method: GET