springdoc-openapi icon indicating copy to clipboard operation
springdoc-openapi copied to clipboard

Springdoc UI alignment issue - name and description columns

Open boudhayan-dev opened this issue 2 years ago • 0 comments

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.

image

To Reproduce

  1. Spring doc integration with spring boot
  2. spring version - 2.7.3
  3. Spring-doc version - 1.6.9
  4. 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

boudhayan-dev avatar Sep 22 '22 08:09 boudhayan-dev