swagger-api / swagger-api/swagger-codegen

[Python][Flask] Generate enum constants

Open
#6,529 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

No constants generated for swagger enums.

Swagger-codegen version

2.2.3

Swagger declaration file content or url
definitions
  FooEnum:
    type: string
    enum:
      - baz
      - bar

yields just a stub model file

Command line used for generation

java -jar swagger-codegen-cli.jar generate -l python-flask

Suggest a fix/enhancement

Produce enum constants as is done in the python client models.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the python-flask generator's model templates and compare them with the Python client model generation, which already produces enum constants. Verify the generated FooEnum model contains constants for baz and bar rather than only a stub.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.