Skip to content

Python client with codegen 2.3.0 does not include api_client attribute in configuration which breaks tests after generation #7325

Open
@peacepirate

Description

@peacepirate
Description

When generating python client with codegen 2.3.0, the Configuration class does not initialize an api_client attribute. This attribute is expected in the DefaultApi class initialization and hence fails the tests we are trying to run via CI automation.

This issue does not exist in 2.2.3 and has been tested and verified for the same OpenAPI spec.

Swagger-codegen version

2.3.0

Swagger declaration file content or url

Unfortunately the spec file is in a private repository right now so cannot be shared.

Command line used for generation

swagger-codegen generate -i api.yaml -l python -o python_client/ -c config/python.json

Steps to reproduce
  1. Create the python_client and
  2. Run the unit tests which would initialize the client.
    This would fail because of "config object has no attribute api_client"
Related issues/PRs
Suggest a fix/enhancement

Either initialize the api_client in configuration if it is in use, or otherwise remove the instances of config.api_client from DefaultApi class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions