Skip to content

[BUG][Python-experimental] UnboundLocalError: local variable 'obj_dict' referenced before assignment #5550

@sebastien-rosset

Description

@sebastien-rosset

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 search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

When invoking a Python API to create a composed model, the following error is raised:

UnboundLocalError: local variable 'obj_dict' referenced before assignment

I think this is because at this line, we are missing a condition for ModelComposed:
modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache:249

openapi-generator version

master March 6th 2020

OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
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