Skip to content

[BUG][PYTHON] Lazy Imports Is Broken Starting In 7.16.0 #23781

@hawartens

Description

@hawartens

Bug Report Checklist

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

It appears that lazy imports in python are broken again.

openapi-generator version

I believe this is a regression. Starting with openapi-generatotor-cli 7.15.0 it appeared that it was using python3-lazy-imports. This caused things to be MUCH better/more responsive in python since not everything had to be loaded beforehand. However it appears that in openapi-generatotor-cli 7.16.0 these changes don't work as they did in the previous version.

using openapi-gernator-cli 7.15.0 generated code
time ./myapp --help
real 0m0.581s
user 0m1.207s
sys 0m5.146s

using openapi-gernator-cli 7.16.0 generated code
time ./myapp --help
real 0m8.325s
user 0m8.138s
sys 0m5.448s

OpenAPI declaration file content or url
Generation Details
Steps to reproduce

Generated code by doing:
java -DmaxYamlCodePoints=99999999 -jar path/to/openapi-generator-cli-$(GENERATORVERSION).jar generate --skip-validate-spec -i myclient.spec
--inline-schema-options REFACTOR_ALLOF_INLINE_SCHEMAS=true --additional-properties=useOneOfDiscriminatorLookup=true --additional-properties=disallowAdditionalPropertiesIfNotPresent=false -g python -o src/myclient -p packageName=myclient -p packageVersion=$(MODULEVERSION)

Related issues/PRs
Suggest a fix

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