Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Bug: Jsonschema of DocList not correct #1521

Description

@JohannesMessner

DocList does not generate a correct JSONSchema; the schema of the documents in the doclist do not show up:

from docarray import BaseDoc, DocList
import pydantic


class Doc(BaseDoc):
    ...


print(pydantic.schema_of(DocList[Doc]))
print(pydantic.schema_of(List[Doc]))

class DocDoc(BaseDoc):
    docs: DocList[Doc]

print(print(DocDoc.schema()))

This is the cause of OpenAPI through FastAPI not working properly, as seen in #1449

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions