swagger-api / swagger-api/swagger-codegen

Using APIClient (Python) in AWS Lambda function

Open
#12,368 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

When trying to use the ApiClient class generated, I get an error, "No such file or directory". Upon further investigation, it
appears this is occurring because the client creates a ThreadPool, which isn't allowed in AWS Lambda

Swagger-codegen version

3.0.54 via Docker at swaggerapi/swagger-codegen-cli-v3

Swagger declaration file content or url

n/a - cannot post in a public forum without nda

Command line used for generation
Python - -i {json url} -l python -DapiTest=false -DmodelTests=false -DapiDocs=false -DmodelDocs=false -Dmodels -c ./local/config.json -o ./local
Steps to reproduce

client = ApiClient()

throws error

Related issues/PRs

n/a

Suggest a fix/enhancement

Maybe the ability to disable the use of Thread Pools? If there is a way to do this without modification, please let me know.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the generated Python ApiClient entry point and its ThreadPool initialization; no repository file or test is named, so locate the template or generated-client path first. Reproduce the ApiClient() failure in AWS Lambda, then define completion as a supported way to avoid or disable the pool, covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, python
Domain
api, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.