Skip to content

[Python] Add function to get list of allowed enum vars #9745

@ghost

Description

Description

We have a lot of enums defined in our backend. We have a small UI that shows these enums as a dropdown. The problem we face is whenever we update the enums on our backend. We have to update the frontend code. If swagger codegen can provide the enum values as a list we can return that in an API for frontend to populate these values or use this function to render it in django forms.

For example:

Consider this class

PLACED = "placed"
APPROVED = "approved"
DELIVERED = "delivered"

It has enums placed, approved, delivered. But there is no way for me to get these values as a list at the moment.

Swagger-codegen version

2.4.8

Suggest a fix/enhancement

Add a function that returns the list of enum vars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions