Skip to content

With multiple callbacks defined on the same URL, you can not expand one callback box #5536

Open
@jmini

Description

@jmini

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

Try it online: https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jmini/openapi-experiments/master/OpenAPI-specs/callbackMultiple.yaml#/

To reproduce...

When you open the spec using Swagger-UI, you see the expected callbacks:

There are 2 box:

  • myEvent
  • otherEvent

Screenshot 2019-08-19 at 11 03 20

When you click to expand one callback "[POST] {$request.body#​/callbackUrl}" box under "myEvent", then:

Current result

Both callbacks boxes are expanded

Screenshot 2019-08-19 at 11 07 11

Expected result

Only the box that was clicked gets expanded.

This is important, especially when a lot of events are present

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions