swagger-api / swagger-api/swagger-ui

Ability to rename additionalProperties keys

Open
#5,713 8 comments 25 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:

{
   type: 'object',
   additionalProperties: {
       $ref: '#/components/schemas/item',
   },
}

Rendered schema in swagger UI :

{
   "additionalProp1": {},
   "additionalProp2": {},
   "additionalProp2": {}
}
Problem :

Here, we're totally losing the context of the objects keys. And users of my api don't know at all what is "additionalProp1" means.
In my case, each objects keys are email address and this important information is totally lost.

Possible solution :

If we could rename the automatic key prefix, it would be great ! :

Rendered schema in swagger UI

{
   "dynamicEmailAddress1": {},
   "dynamicEmailAddress2": {},
   "dynamicEmailAddress3": {}
}

But I don't know if it's doable to insert a new property somewhere (like additionalPropertiesPrefix: 'dynamicEmailAddress' in the open api schema, so, sorry in advance if it's not the case.

Thanks

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, tests, or entry points. Start by locating how Swagger UI renders OpenAPI additionalProperties and determine whether a custom key prefix is compatible with the specification. Done means an agreed, tested way to show meaningful labels without changing the schema semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
documentation, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.