swagger-api / swagger-api/swagger-codegen
Model Example Values Not Displayed, Only Data Types Visible
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
After upgrading to Swagger Codegen version 3.0.68, I encountered a problem where examples defined in my YAML file are not displayed in Swagger UI. Instead, only data types (like string and for integer values it shows 0, etc.) are visible. In previous versions like 3.0.20 and 3.0.34, examples were correctly shown. Can you provide any solution or any other way to ensure that examples appear correctly in Swagger UI while using version 3.0.68, as downgrading is not an option
I am attaching JSON format for reference:-
"sipServerDetails": {
"address": "string",
"name": "string",
"packetLost": 0,
"packetReceived": 0,
"port": 0,
"priority": 0,
"status": "string",
"weight": 0
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported behavior with the YAML definition and Swagger Codegen 3.0.68, then compare the generated Swagger UI output with versions 3.0.20 and 3.0.34. Trace how the model examples become the shown JSON values, and consider the issue done when defined examples are displayed correctly without downgrading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100