swagger-api / swagger-api/swagger-ui
Ability to rename additionalProperties keys
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
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
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