swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

When class extends ArrayList the generated schema has no "items" property

Open didjoman opened this issue 3 years ago • 0 comments

Hello, When generating a swagger documentation for a class extending ArrayList, the schema of the class doesn't have the "items" property. It happens with this particular schema: arrayList

Here is a demo project using Java 11, SpringBoot 2.7.2, springdoc-openapi-webmvc-core 1.6.10 based on Swagger-core 2.2.2: https://github.com/didjoman/springdoc-extension-of-arraylist-issue

The issue can be observed when doing this:

ResolvedSchema resolvedSchema  = ModelConverters.getInstance()
	.resolveAsResolvedSchema(new AnnotatedType(Knowledge.class).resolveAsRef(true));
		
// Then check resolvedSchema.referencedSchemas.get("Books")

I initially opened this springdoc/springdoc-openapi#1800, and bnasslahsen told me the issue was on Swagger-core.

didjoman avatar Aug 30 '22 08:08 didjoman