Skip to content

Ability to rename additionalProperties keys #5713

Open
@ctiaffay-conserto

Description

@ctiaffay-conserto

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions