diff --git a/litestar/_openapi/responses.py b/litestar/_openapi/responses.py index 6b0f312d3c..11cc2a8349 100644 --- a/litestar/_openapi/responses.py +++ b/litestar/_openapi/responses.py @@ -293,7 +293,11 @@ def create_error_responses(exceptions: list[type[HTTPException]]) -> Iterator[tu "status_code": Schema(type=OpenAPIType.INTEGER), "detail": Schema(type=OpenAPIType.STRING), "extra": Schema( - type=[OpenAPIType.NULL, OpenAPIType.OBJECT, OpenAPIType.ARRAY], + any_of=[ + Schema(type=OpenAPIType.NULL), + Schema(type=OpenAPIType.OBJECT), + Schema(type=OpenAPIType.ARRAY, items=Schema()), + ], additional_properties=Schema(), ), },