swagger-api / swagger.io-docs

The content of swagger.io
https://swagger.io/docs/
1.56k stars 404 forks source link

Syntax issues with callback examples #345

Open lodup29 opened 8 months ago

lodup29 commented 8 months ago

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