swagger-api / swagger-api/swagger-ui
Add better property, & "alternate type", level deprecated support in documentation generation
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:
/bar:
put:
deprecated: true
parameters:
- name: baz
deprecated: true
in: query
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
a:
type: integer
b:
deprecated: true
type: integer
c:
oneOf:
- type: boolean
- type: integer
deprecated: true
application/xml:
schema:
type: object
properties:
a:
type: integer
xml:
name: _foo_
Is your feature request related to a problem?
While efficientely clear at the path method & query parameter levels, the deprecation status is not clear enough at the property level & for property alternative types


We currently have different/inconsistent representations of the deprecated status depending or where it applies
| Level | Strike | Grey | Warning | Red deprecated | deprecated: true | drop in example |
|---|---|---|---|---|---|---|
| method | ✔️ | ✔️ | ✔️ | ❌ | ❌ | NA |
| parameter | ❌ | ✔️ | ❌ | ✔️ | ❌ | NA |
| property | ❌ | ✔️ | ❌ | ❌ | ✔️ | ✔️ |
| oneOf type | ❌ | ✔️ | ❌ | ❌ | ✔️ | ❌ |
| ref | ❌ | ❌ | ❌ | ❌ | ✔️ | ❌ |
Describe the solution you'd like
Wherever a depracated flag is set, I'd expect a uniform combo of:
- grey/italic fonct style & color
- a red warning message
Additional context
Moreover
The deprecated flag is not accepted at (by schema) at those levels:
- media type to deprecate a media type alternative (either in requestBody or responses)
pathsproperty (ex/foo) to deprecate an URI whatever the method (currently requires onedeprecatedper method)rootorinfo, to deprecate a whole API definition (would currently require adeprecatedfor each method of each path)serversitem, to deprecate a server configuration compared to the others
but this should be a separated feature request ;-)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Swagger/OpenAPI definition in the issue and trace how documentation generation renders deprecated methods, parameters, properties, and oneOf types. Compare the existing representations shown in the table and examples; done means deprecated properties and alternative types consistently receive grey italic styling and a red warning message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100