Skip to content

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

@didjoman

Description

@didjoman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions