swagger.io icon indicating copy to clipboard operation
swagger.io copied to clipboard

Syntax issues with callback examples

Open lodup29 opened this issue 1 year ago • 1 comments

I believe that there are a few syntax issues (mainly indentations) with the example provided here and that the complete example should be:

openapi: 3.0.0
info:
  version: 0.0.0
  title: test
paths:
  /subscribe:
    description: Add a subscriber
    post:
      parameters:
        - name: callbackUrl
          in: query
          required: true
          schema:
            type: string
            format: uri
        - name: event
          in: query
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Added
          content:
            application/json:
              schema:
                type: object
                properties:
                  subscriberId: 
                    type: string
                    example: AAA-123-BBB-456                    
          links:  # Link the returned id with the unsubscribe operation
            unsubscribeOp:
              operationId: unsubscribeOperation
              parameters: 
                Id: $response.body#/subscriberId
      callbacks:
        myEvent:
          '{$request.query.callbackUrl}?event={$request.query.event}':
            post:
              requestBody:
                content:
                  application/json:
                    example:
                      message: Some event
              responses:
                '200':
                  description: OK
              
  /unsubscribe:
    post:
      operationId: unsubscribeOperation
      parameters:
        - name: Id
          in: query
          required: true
          schema:
            type: string
      responses:
        200:
          description: OK

lodup29 avatar Mar 17 '24 20:03 lodup29

@lodup29 The indentation looks OK to me. Perhaps this was seen before we revamped our docs site.

frankkilcommins avatar Jul 30 '25 09:07 frankkilcommins