swagger-api / swagger-api/swagger-ui
Swagger UI expand/collapse for Enum component.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: macOS
- Browser: chrome
- Version: Latest
- Swagger-UI version: 3.52.3
Description
When I use Enum in components schemas. I can expand the TypeEnum object, but there is no button for me to collapse the object.
There is "arrow" button to expand

While I can collapse Item, I cannot collapse TypeEnum, I have to refresh the page

Example Swagger/OpenAPI definition:
openapi: 3.0.2
info:
title: FastAPI
description: ''
version: 0.1.0
paths:
/items/:
get:
summary: Read Items
operationId: read_items_items__get
parameters:
- required: false
schema:
title: Q
maxLength: 50
type: string
name: q
in: query
responses:
'200':
description: Successful Response
content:
application/json:
schema:
title: Response Read Items Items Get
type: array
items:
$ref: '#/components/schemas/Item'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
HTTPValidationError:
title: HTTPValidationError
type: object
properties:
detail:
title: Detail
type: array
items:
$ref: '#/components/schemas/ValidationError'
Item:
title: Item
required:
- name
- price
- tags
type: object
properties:
name:
title: Name
type: string
description:
title: Description
type: string
price:
title: Price
type: number
tax:
title: Tax
type: number
tags:
$ref: '#/components/schemas/TypeEnum'
TypeEnum:
title: TypeEnum
enum:
- predicted
- measured
type: string
description: An enumeration.
ValidationError:
title: ValidationError
required:
- loc
- msg
- type
type: object
properties:
loc:
title: Location
type: array
items:
type: string
msg:
title: Message
type: string
type:
title: Error Type
type: string
Expected behavior
There is a arrow button after expanding to collapse the tab.
Screenshots
Additional context or thoughts
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in Swagger UI 3.52.3 using the supplied OpenAPI definition, focusing on the TypeEnum component under Item. Inspect the Enum component's expanded and collapsed states; done means the expanded TypeEnum has an arrow control that collapses it without refreshing the page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100