Redocly / Redocly/redoc

Supply custom "property name" for additionalProperties

Open
#622 11 comments 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Would be nice to better describe/document the keys within additionalProperties where appropriate. I often have mappings where the key isn't completely free form (e.g. a named unique identifier or an integer with some meaning) and would be nice to have the docs relfect that, e.g:

  • players (object)
    • player-id* : object (Player)

rather than

  • players (object)
    • property name* : object (Player)

Will also suggest such a change in the OpenAPI specification but is it possible/desirable to add the ability to override the "property name*" value?

Would also be useful in the generated examples where the keys are "property1", "property2" but could be tied to the name in the docs, e.g. "player-id-1", "player-id-2"

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 tracing how OpenAPI additionalProperties is rendered in the documentation and how generated examples choose keys. Check whether the proposed override is supported by the OpenAPI specification, then define and verify the behavior for the players example in both the rendered property label and generated example keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.