swagger-api / swagger-api/swagger-codegen

Model Example Values Not Displayed, Only Data Types Visible

Open
#12,548 0 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

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.