swagger-api / swagger-api/swagger-ui

Swagger UI renders parameter descriptions and response descriptions in monospace

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

Nobody has claimed this yet.

cat: style & presentation P3 type: enhancement
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Swagger UI renders parameter descriptions and response descriptions in monospace

Q A
Bug or feature request? bug
Which Swagger/OpenAPI version? 2.0
Which Swagger-UI version? 3.6.1
How did you install Swagger-UI? pull from GigHub and deploy dist to localhost web server
Which browser & version? Chrome 63.0.3239.132 (Official Build) (64-bit)
Which operating system? OS X Hi Siersa 10.13.1
your: "API definition goes here"
Configuration (browser query string, constructor, config.yaml)
swagger: '2.0'

info:

  title: Swagger UI Markdown Issue
  description: Is [Markdown](http://commonmark.org/help/) handled in Swagger UI?
  version: '2018-01-29'
basePath: /exampleApi
paths:
  /models/{modelId}:
    parameters:
      - name: modelId
        in: path
        description: Is [Markdown](http://commonmark.org/help/) handled in Swagger UI?
        type: string
        required: true
    get:
      responses:
        '200':
           description: >-
             *OK*

             Is [Markdown](http://commonmark.org/help/) handled in
             Swagger UI?
             
             The response contains a `date` and a unique `id`
           schema: 
             $ref: '#/definitions/model'
             
definitions:

  model:
    properties:
      date:
        description: >-
          The model's date

          Is [Markdown](http://commonmark.org/help/) handled in Swagger UI?
        type: string
        format: date-time
      id:
        description: "The model's unique ID"
        type: string
    example:
      id: 1
      date: 2018-01-22T03:43:57.375Z

Expected Behavior

descriptions and other text should be in normal text font, not monospace.
Text within the descriptions may use backticks to result in monospace,
but

Current Behavior

if everything is monospace, such text is not distinguishable.
See screenshot
screen shot 2018-01-29 at 9 07 28 am

Possible Solution
Context

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 loading the supplied Swagger 2.0 definition in Swagger UI and inspect how the parameter and response descriptions are rendered. Trace the styling or rendering path responsible for those descriptions; done means ordinary description text uses a normal font while text within backticks remains monospace.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.