swagger-api / swagger-api/swagger-codegen

swagger-codegen-cli-2.4.21.jar -l html creates empty "examples"

Open
#11,891 2 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
Swagger-codegen version

Generated correctly with 2.4.20, but no longer with 2.4.21

Swagger declaration file content or url
          "examples" : [ {
            "contentType" : "application/json",
            "example" : "{\"empty\": false}"
          } ],
Command line used for generation

-DdebugSupportingFiles -l html

Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

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 issue with swagger-codegen-cli 2.4.21 using -DdebugSupportingFiles -l html, then compare the generated output with version 2.4.20. Trace how the supplied examples entry with contentType and example is handled during HTML generation. Done means the HTML output no longer contains an empty examples section and preserves the provided example.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, java
Domain
cli, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.