Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issues#2318]Add Info to GroupedOpenAPI properties #2551

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package org.springdoc.core.configurer;

import java.util.List;
import java.util.Optional;

import io.swagger.v3.oas.models.OpenAPI;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -98,6 +99,9 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
builder.packagesToExclude(elt.getPackagesToExclude().toArray(new String[0]));
if (StringUtils.isNotEmpty(elt.getDisplayName()))
builder.displayName(elt.getDisplayName());
if (Optional.ofNullable(elt.getApiInfo()).isPresent()) {
builder.addOpenApiCustomizer(openApi -> openApi.info(elt.getApiInfo()));
}
return builder.group(elt.getGroup()).build();
})
.toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Set;

import io.swagger.v3.oas.models.SpecVersion;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.configuration.SpringDocConfiguration;
import org.springdoc.core.properties.SpringDocConfigProperties.ApiDocs.OpenApiVersion;
import org.springdoc.core.utils.Constants;
Expand Down Expand Up @@ -1516,6 +1517,11 @@ public static class GroupConfig {
*/
private String displayName;

/**
* The object provides metadata about the API
*/
private Info apiInfo;

/**
* Instantiates a new Group config.
*/
Expand Down Expand Up @@ -1712,6 +1718,22 @@ public void setDisplayName(String displayName) {
this.displayName = displayName;
}

/**
* Gets api info
* @return the api info
*/
public Info getApiInfo() {
return apiInfo;
}

/**
* Sets api info
* @param apiInfo the api info
*/
public void setApiInfo(Info apiInfo) {
this.apiInfo = apiInfo;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down