Skip to content

Add title property to GroupedOpenApi class for displaying a Human readable group name #1596

Closed
@mzeijen

Description

@mzeijen

We are migrating from using the Swagger Maven plugin to SpringDoc. We had our custom grouping solution for being able to handle multiple API definitions. In our own custom Swagger UI setup, we show these different groups in a list. This is similar to how SpringDoc does this as well for its Swagger UI implementation.
However in our solution we allow the user to define the group identifier as well as a group display title. With SpringDoc we only have the group property in the GroupedOpenApi class, and we currently utilise it as both the identifier and the title, which is sub optimal as this then is both the identifier and the title. If a user would change it, because they want a nicer looking group name, they would inadvertently also change the identity of the group.

I propose we add a property (e.g. title, displayName or something similar) to the GroupedOpenApi that allows defining the human title of the group.

An alternative we considered is to extract the title from the OpenAPI Info object, and use it as the group title. However we believe they serve different purposes. For instance, the group title might need to be a shorter variant of the OpenAPI definition title, so that the list on the Swagger UI is easier to read, without compromising on the more extensive title of the definition itself.

If you agree with adding the property, I am willing to create a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions