Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #8499
Closed
Open
Issue created Jan 21, 2021 by Administrator@rootContributor

[PYTHON-LEGACY] Use programmer-provided Configuration() objects when possible

Created by: adpoliak

Description

The generated PACKAGENAME.configuration.Configuration() class has means of persisting options via its set_default() class method.
However, in order for the persisted options to be used on future instances, the Configuration.get_default_copy() class method must be used instead of the Configurator() constructor. This isn't currently done in any of the generated models, so the programmer is unable to override self.local_vars_configuration.client_side_validation to help deal with non-conforming server responses. Updating the Python templates to use the get_default_copy() class method solves this.

openapi-generator version

5.0.1-SNAPSHOT (commit 3d23b992)

OpenAPI declaration file content or url

https://bitwarden.com/help/api/specs/public/swagger.json (relevant to why I'm working with openapi-generator, but unrelated to the issue itself)

Command line used for generation
PYTHON_POST_PROCESS_FILE="/opt/local/bin/yapf -i" \
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate --skip-validate-spec \
-i ../PROJECT/input/swagger.json -g python-legacy -o ../PROJECT --enable-post-process-file \
--library=asyncio --verbose --package-name=PACKAGE_NAME --git-host=GIT-SERVER --git-user-id=GIT-USER \
--git-repo-id=GIT-REPO-ID --additional-properties=hideGenerationTimestamp=false,projectName=PROJECT_NAME
Steps to reproduce

Generate the API Client with the existing templates

Related issues/PRs

N/A

Suggest a fix/enhancement

The Contributing Guidelines say to submit an issue before submitting a PR. It will be submitted shortly.

Assignee
Assign to
Time tracking