swagger-api / swagger-api/swagger-ui

Display "Server Variable Object" descriptions

Open
#8,365 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Content & configuration

Swagger/OpenAPI definition:

{
   "openapi": "3.0.3",
   "info": {
   	"title": "Wikibase REST API",
   	"version": "0.1",
   	"description": "OpenAPI definition of the Wikibase REST API",
   	"contact": {...},
   	"license": {...}
   },
   "paths": { "$ref": "./resources/index.json" },
   "components": {...},
   "tags": [...],
   "servers": [
   	{
   		"url": "https://{domain}/w/rest.php/wikibase/v0",
   		"variables": {
   			"domain": {
   				"default": "wikibase.example",
   				"description": "The domain of the Wikibase instance"
   			}
   		}
   	}
   ]
}

Swagger-UI configuration options:

SwaggerUI( { spec, dom_id: '#swagger' } );
Is your feature request related to a problem?

I'm frustrated when I add a description to an OpenAPI definition and it isn't rendered in the Swagger UI. In particular the "description" field on the Server Variable Object. In the example above this is the string "The domain of the Wikibase instance".

Describe the solution you'd like

I would like the "description" field on the Server Variable Object to be displayed.

Describe alternatives you've considered
Additional context

A very rough example:

image

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 at the SwaggerUI({ spec, dom_id: '#swagger' }) entry point and trace how the supplied OpenAPI servers and variables are rendered. Use the example definition as the fixture and verify that the Server Variable Object description appears in the generated UI; done means the "domain" description is visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
documentation, frontend
Issue type
Feature
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.