swagger-api / swagger-api/swagger-codegen

[java] How to show the value of enum in api?

Open
#4,591 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

entity
enum
example
model

gender (string): 性别 = ['male', 'female']stringEnum:"male", "female"
I want it show like this:
gender (string): 性别 = ['1', '2']stringEnum:"male", "female"

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

The issue provides screenshots and the desired enum output, but names no source file, test, or entry point. Start by locating the Java API documentation generation path responsible for enum fields; done means the generated output preserves values such as '1' and '2' while displaying labels such as 'male' and 'female'.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.