Skip to content

[BUG] [python-experimental] BooleanEnum.TRUE is BooleanEnum(True) fails #12159

@spacether

Description

@spacether

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?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

BooleanEnum.TRUE is BooleanEnum(True) fails
This should work because instantiated enums are stored in a class constant in the Singleton class.
BooleanEnum.TRUE.class DynamicDynamicBooleanEnum? It should only have one Dynamic
So it looks like there is an incorrect extra layer of class creation happening here
Track it down and remove it
Then BooleanEnum.TRUE is BooleanEnum(True) will work

openapi-generator version

Latest master branch

OpenAPI declaration file content or url

N/A use the python-experimental sample

Generation Details

N/A

Steps to reproduce

assert BooleanEnum.TRUE is BooleanEnum(True)

Related issues/PRs

This came up when investigating #12151
and writing the fix #12157

Suggest a fix

Remove the extra layer of class creation

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