-
-
Notifications
You must be signed in to change notification settings - Fork 535
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Describe the bug
- Resolver error occurs when use
custom OpenApiCustomiser
toGroupedOpenApi
- without
addOpenApiCustomiser()
, it works well.
To Reproduce
Steps to reproduce the behavior:
- What version of spring-boot you are using?,
2.6.3
- What modules and versions of springdoc-openapi are you using?,
latest
- Provide with a sample code (HelloController) or Test that reproduces the problem
@Configuration
public class SwaggerOpenApiConfiguration {
@Bean
public GroupedOpenApi channelApiGroup() {
// sample conditions for GroupedOpenApi
String[] paths = { "/v1/pet/**" };
return GroupedOpenApi.builder().group("channel-gateway")
.pathToMatch(paths)
// if comment out the line below, resolver error occurs
.addOpenApiCustomiser(globalOpenApiCustomer())
.build();
}
public static OpenApiCustomiser globalOpenApiCustomer() {
return openApi ->
openApi.info(new Info()
.title(TITLE)
.description(DESCRIPTION)
.license(new License().name(LICENSE).url(LICENSE_URL))
.termsOfService(TERMS_OF_SERVICE_URL)
.version(VERSION))
// plus the request header also invisible
.components(new Components()
.addParameters("test",
new Parameter()
.name("testHeader")
.required(true)
.in("header")
.description("testDescription").
schema(new StringSchema())))
}
}
Expected behavior
- The swagger-ui.html work without any errors like demo springdoc-openapi swagger-ui.html page
Additional context
- Plus, I add custom headers for trying out swagger with parameters, it is invisible.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested