-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Labels
P2pull-request-welcomeIf a PR were to be made, we would help get it mergedIf a PR were to be made, we would help get it mergedtype: bug
Description
Q&A (please complete the following information)
- OS: Windows 11
- Browser: Chrome
- Version: 140.0.7339.208
- Method of installation: dist assets
- Swagger-UI version: 5.28.0
- Swagger/OpenAPI version: OpenAPI 3.1
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.1.0
info:
title: test
description: test
version: 1.0.0
servers:
- url: http://localhost:5000
description: test
paths:
/api/user:
get:
summary: get user
responses:
'200':
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/User'
components:
schemas:
User:
type: object
properties:
id:
type: integer
name:
type: string
friends:
type: array
items:
type: object
allOf:
- $ref: '#/components/schemas/User'
- type: object
required:
- id
security:
- {}
Swagger-UI configuration options:
SwaggerUI({
url: "/schema.yaml",
dom_id: '#swagger-ui'
Describe the bug you're encountering
Expanding the attached User schema in Swagger UI shows the following error:
Errors
Resolver error at properties.friends.items.allOf
Elements in allOf must be objects
This schema works without error under OpenAPI 3.0.0. Under 3.1.0, the error appears when an object schema has an array property whose items definition combines a self-referential $ref
and an allOf
that adds constraints.
To reproduce...
- Load the OpenAPI 3.1.0 document above in Swagger UI.
- Expand components > schemas > User.
Expected behavior
The schema resolves and renders without errors, matching OpenAPI 3.0.0 behavior.
Screenshots

Metadata
Metadata
Assignees
Labels
P2pull-request-welcomeIf a PR were to be made, we would help get it mergedIf a PR were to be made, we would help get it mergedtype: bug