OpenAPITools / OpenAPITools/openapi-generator
[BUG] Python client tests fail (syntax errors)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
After generating a python client for peertube, the tests don't run due to syntax errors:
openapi-generator version
@openapitools/openapi-generator-cli^1.0.10-4.2.3
OpenAPI declaration file content or url
Command line used for generation
It's run in a bash script by a CI that calls the npm package. bash script | npm package (@openapitools/openapi-generator-cli^1.0.10-4.2.3) (line in yarn.lock)
the resulting command should be
npx openapi-generator generate
-i support/doc/api/openapi.yaml
-c "support/openapi/python/def.yaml"
-t "support/openapi/python"
-g "python"
--git-host "framagit"
--git-user-id "peertube-test"
--git-repo-id "apis/python"
-o "dist/api/python"
Steps to reproduce
- Generate python client from peertube api spec
- install virtualenv in output directory
- install
requirements.txtandtest-requirements.txt pytest
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/1747 had similar issues but the output was ignored? I'm not entirely sure.
Suggest a fix
Update the template to use the correct fieldnames. They are correctly generated in the model, but not in the test file.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by generating the Python client from the linked PeerTube OpenAPI declaration using the shown command and the support/openapi/python/def.yaml configuration, then run pytest in the generated output. Compare the syntax error in test/test_server_config_custom_transcoding.py with the corresponding generated model fields. Done means the generated tests parse and run without syntax errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, python
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100