springdoc-openapi
springdoc-openapi copied to clipboard
Springdoc UI alignment issue - name and description columns
Describe the bug
Swagger UI has alignment issues between the Name column and Description column. Attached is a screenshot, where you can see the marked arrows where the description should ideally begin. However, it seems to start slightly below.
To Reproduce
- Spring doc integration with spring boot
- spring version - 2.7.3
- Spring-doc version - 1.6.9
- Highlighted header section is constructed using the following code -
public class SwaggerConfiguration {
@Bean
public OpenAPI customOpenAPI() {
StringSchema schema = new StringSchema();
return new OpenAPI()
.components(new Components()
.addParameters("invoked_by", new HeaderParameter().required(false).name("invoked_by").description("Email ID of the invoking user").schema(schema))
.addParameters("tenant_id", new HeaderParameter().required(false).name("tenant_id").description("Sub-account/Tenant ID of the invoking user").schema(schema))));
}
@Bean
public OpenApiCustomiser customerGlobalHeaderOpenApiCustomiser() {
return openApi -> openApi.getPaths().values().stream().flatMap(pathItem -> pathItem.readOperations().stream())
.forEach(operation ->
operation
.addParametersItem(new HeaderParameter().$ref("#/components/headers/invoked_by").description("Email ID of the invoking user").name("invoked_by"))
.addParametersItem(new HeaderParameter().$ref("#/components/headers/tenant_id").description("Sub-account/Tenant ID of the invoking user").name("tenant_id")));
}
}
Expected behavior
- For a particular header/parameter/response code, the name and description values should vertically align.
Screenshots
- Added above