swagger-api / swagger-api/swagger-codegen

Example responses not shown in generated HTML2 artifacts (v 3.0.0 snapshot)

Open
#8,382 0 comments 1 reaction 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

I am comparing how the same spec file looks in the waggerhub editor and the static html created by
swaggen generate -i ./api.json -l html2 -o ./generatedDocs/.

  • There html2 is missing the JSON examples for the responses
  • Models are not rendered at all
Swagger-codegen version

3.0.0-SNAPSHOT

Swagger declaration file content or url

(for YAML code) or

"components": {
    "schemas": {
      "Tweet": {
        "type": "object",
        "required": [
          "id",
          "create_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "user": {
            "type": "object",
            "$ref": "#/components/schemas/User"
          }
        },
        "example": {
          "id": "12234",
          "created_at": "Wed Jun 20 16:53:49 +0000 2018",
          "text": "Some great insight into the human condition",
          "user": {
            "$ref": "#/components/schemas/User/example"
          }
        }
      }
 }
}

(for JSON code), so it becomes more readable. If it is longer than about ten lines,
please create a Gist (https://gist.github.com) or upload it somewhere else and
link it here.
-->

Command line used for generation

swaggen generate -i ./twitter_api.json -l html2 -o ./generatedDocs/.

Steps to reproduce

do above and look at results

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 swaggen generate -i ./twitter_api.json -l html2 -o ./generatedDocs/. and compare the generated HTML2 output with the SwaggerHub editor. Trace the HTML2 generation path for response examples and models; done means both JSON response examples and models appear in the generated static HTML.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.