Skip to content

[BUG] Newly generated [python-legacy] repo failing tests #7834

@davidhao3300

Description

@davidhao3300

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists? - Tested with openapi-cli-generator tool, so tested latest published version
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output? Described below
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

A newly generated python repo produces python tests. For the attached example, the error is AttributeError: module 'openapi_client.models.user_response_data' has no attribute 'UserResponse_data'.

openapi-generator version

The latest version (4.3.1) has this issue, but this issue goes back to 4.2.3. 4.2.2 is the newest version that doesn't generate failing tests.

OpenAPI declaration file content or url

https://gist.github.com/davidhao3300/c9584ee864bfbc6ca3d273d5c918509f

Generation Details

openapi-generator-cli generate -g python -i {path to swagger.json}

Steps to reproduce
python3 -m venv venv
source venv/bin/activate
openapi-generator-cli generate -g python -i {path to swagger.json}
pip install -r requirements.txt
pip install -r test-requirements.txt
python -m pytest test/
Related issues/PRs

Could not find one

Suggest a fix

I haven't done a bisect beyond knowing the issue is between 4.2.2 and 4.2.3. Happy to do a bisect if openapi-generator-cli is able to point to commits instead of git tags.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions