Redocly / Redocly/redoc

Make discriminator values easy to copy, e.g. by automatically adding a single-value enum to discriminators

Open
#1,690 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

need-design Type: Enhancement
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

When selecting discriminator values in the dropdown, there is no easy way to copy the value.

image

It would be nice if it was possible to easily copy the value.

Since the discriminator is in effect an enum, ReDoc could render an enum value equal to the currently selected option. For reference, this is the kind of enum rendering I am talking about:

image

Other solutions may also exist.

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

The issue names no files or tests; start by locating the discriminator dropdown and its selected-value rendering in ReDoc. Compare the requested single-value enum presentation with the attached examples, and consider the work done when the selected discriminator value can be copied easily.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
documentation, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.