aws / aws/chalice

Is it possible to include `chalice` library in lambda package?

Open
#1,813 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

I'd like to use chalice library inside one of my API endpoints to return swagger schema.
But `chalice` library is excluded by default.
Here is an example of my API endpoint:
```python
@app.route("/api/v1/swagger/docs", methods=["GET"], cors=cors_config)
def swagger():
from chalice.deploy.swagger import TemplatedSwaggerGenerator

schema = TemplatedSwaggerGenerator().generate_swagger(app)
return json.dumps(schema)
```

Also, I'd like to mention that `chalice` is awesome! I love it!

Contributor guide

Open the contributing guide

Research direction

Start from the deployment packaging path and the referenced chalice.deploy.swagger.TemplatedSwaggerGenerator import, then check how the Lambda package excludes Chalice. Done means an API endpoint can import that library and generate the Swagger schema at runtime without breaking the normal deployment flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.