swagger-api / swagger-api/swagger-ui
With multiple callbacks defined on the same URL, you can not expand one callback box
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: 76.0.3809.100 (Official Build) (64-bit)
- Method of installation: online
- Swagger-UI version: -
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.0.0
info:
version: 1.0.0
title: test
description: example with 2 callbacks
paths:
/subscribe:
post:
summary: Subscribe to a webhook
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
callbackUrl:
type: string
format: uri
example: https://myserver.com/send/callback/here
required:
- callbackUrl
callbacks:
myEvent:
'{$request.body#/callbackUrl}':
post:
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Some event happened
required:
- message
responses:
'200':
description: Your server returns this code if it accepts the callback
otherEvent:
'{$request.body#/callbackUrl}':
post:
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
id:
type: integer
format: int32
example: 42
required:
- id
responses:
'200':
description: Your server returns this code if it accepts the callback
responses:
'201':
description: Webhook created
In this git repo: callbackMultiple.yaml
To reproduce...
When you open the spec using Swagger-UI, you see the expected callbacks:
There are 2 box:
- myEvent
- otherEvent
When you click to expand one callback "[POST] {$request.body#/callbackUrl}" box under "myEvent", then:
Current result
Both callbacks boxes are expanded
Expected result
Only the box that was clicked gets expanded.
This is important, especially when a lot of events are present
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
Start by loading the callbackMultiple.yaml example from the issue in Swagger UI and reproduce the expansion behavior for myEvent and otherEvent. Trace the callback rendering and expansion state handling, then verify that expanding one callback leaves the other collapsed.
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
- Clearly specified
- Newbie friendliness
- 48/100